How to get the current timestamp in other timezones in Golang?
//init the loc
loc, _ := time.LoadLocation("Asia/Shanghai")
//set timezone,
now := time.Now().In(loc)
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).