Created
July 22, 2013 14:52
-
-
Save hnakamur/6054434 to your computer and use it in GitHub Desktop.
parse ISO8601 datetime in go http://play.golang.org/p/xe2mWIHZGU
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"time" | |
) | |
func main() { | |
t, err := time.Parse(time.RFC3339Nano, "2013-06-05T14:10:43.678Z") | |
if err != nil { | |
panic(err) | |
} | |
fmt.Println(t) | |
} |
This is a valid ISO 8601 timestamp: "2016-08-06T17:20:33.803-0400".
Your code wont' parse it.
2017-01-31T09:12:52
Valid ISO 8601 timestamp
Your code wont' parse it.
Nothing interesting.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Run this code at Go Playground