Skip to content

time: Parse  #4001

@gopherbot

Description

@gopherbot

by webuser1200:

// You can edit this code!
// Click here and start typing.
package main

import (
  "time"
)


func main() {
    splitDate, _ := time.Parse("20060102MST", "20110122EDT")
    ns := splitDate.UnixNano()
    println(ns)
}


which gives 1295654400000000000

but when I go to http://www.epochconverter.com/ and put in the time 1295654400, I get
"Fri Jan 21 2011 19:00:00 GMT-5" which is not correct 
I was expecting "Fri Jan 22 2011 00:00:00 GMT-5" which is what is passed into
time.Parse

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions