I need to get the current time in different time-zones.
Currently I know that we can do the following:
t := time.Now()
fmt.Println(\"Location:\", t.Loca
No, that is the best way. You can create your custom Location
using FixedZone and use that custom location.
FixedZone returns a Location that always uses the given zone name and offset (seconds east of UTC).
//init the loc
loc, _ := time.LoadLocation("Asia/Shanghai")
//set timezone,
now := time.Now().In(loc)