I want to load location via UTC offset, e.g.
func main() {
L, err := time.LoadLocation("UTC+8")
if err != nil {
panic(err)
}
fmt.Println(L)
}
The code panics: panic: unknown time zone UTC+8
How can I get the location object by UTC offset (NOT local nor UTC, but another location), without having to specify it in IANA Time Zone format, such as "America/New_York"
My purpose is simple: I have a web server running in a fixed location, which I can get the local time easily. Now I want to do time calculation based on the location of visitor (which is sent over by a url parameter, e.g. http://myserver.com/do_something?timezone=-8
).