如何获取Golang其他时区的当前时间戳?

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.Location(), ":Time:", t)
utc, err := time.LoadLocation("America/New_York")
if err != nil {
    fmt.Println("err: ", err.Error())
}
fmt.Println("Location:", utc, ":Time:", t.In(utc))

The LoadLocation name is taken to be a location name corresponding to a file in the IANA Time Zone database, such as "America/New_York".

Is there a simpler way to get the current time, if the country name, or the GMT offset is given e.g +530 for India?

Edit: I would also want to support Day light savings.

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)