-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Closed
Labels
Description
Time can't parse the layout constant for RFC3339 in the code itself.
For eg. Go playground link - http://play.golang.org/p/EJH53M__AH
// Time value taken from go source https://github.com/golang/go/blob/master/src/time/format.go#L51
layout := "2006-01-02T15:04:05Z07:00" // RFC3339
tm, err := time.Parse(layout, layout)
if err != nil {
fmt.Println("error", err)
return
}
fmt.Println("Parsed time", tm)
Currently if there is any offset in time (non UTC time), time formats it in RFC3339 as - +07:00 instead of Z07:00
If Z07:00 is given, it gives an error
error parsing time "2006-01-02T15:04:05Z07:00": extra text: 07:00