I tried parsing
Tue Apr 07 2020 11:17:47 GMT+0530 (India Standard Time)
But got the following error
parsing time "Tue Apr 07 2020 11:17:47 GMT+0530 (India Standard Time)" as "2006-01-02T15:04:05Z07:00": cannot parse "Tue Apr 07 2020 11:17:47 GMT+0530 (India Standard Time)" as "2006" 0001-01-01 00:00:00 +0000 UTC
From the frontend i can get timestamp in any format depending on the location or zone.But, in go lang i'm trying to parse any timestamp and convert it to UTC to store in ledger.What is the correct way to handle this case?
t, err := time.Parse(time.RFC3339, str)
if err != nil {
fmt.Println(err)
}
fmt.Println(t)
time.RFC3339.time.RFC3339is for dates like2006-01-02T15:04:05Z