I'm trying to parse a string into time with a user-specific timezone location -
// error handling skipped for brevity
loc, _ := time.LoadLocation("Asia/Kolkata")
now, _ := time.ParseInLocation("15:04", "10:10", loc)
fmt.Println("Location : ", loc, " Time : ", now)
The output I get on my system is - Location : Asia/Kolkata Time : 0000-01-01 10:10:00 +0553 HMT
Where did this HMT
time zone come from?
If instead of parsing the time I use now := time.Now().In(loc)
, the timezone printed is correct - IST
. Am I doing something wrong with timezone parsng or is my system timezone database faulty?