I'm not able to convert the string "2017-12-07T20:01:33+0530"
into a date format. I'm using RFC3339 and RFC3339Nano but still getting the following error:
0001-01-01 00:00:00 +0000 UTC parsing time "2016-01-17 20:04:05 +0530": hour out of range
IST to UTC: 0001-01-01 00:00:00 +0000 UTC
This is my code:
IST, err := time.LoadLocation("Asia/Kolkata")
if err != nil {
fmt.Println(err)
return
}
const longForm = "2006-01-02 15:04:05 +0530"
t, err := time.ParseInLocation(longForm, "2016-01-17 20:04:05 +0530", IST)
fmt.Println(t, err)
fmt.Printf("IST to UTC: %v
", t.UTC())