Parse time zone into a Location struct in Go

2019-03-05 23:47发布

Given a time zone such as EDT or CEST is there a way to get a time.Location reference to use it to with func (t Time) In(loc *Location) Time?

It is possible to initialize the location for e.g. CEST with time.LoadLocation("Europe/Berlin") but how to do the same for the actual time zone notation?

Given the very insightful comment by @Svip is there any sensible way to return a list of representative location? That is for WET return e.g. [Europe/London, Atlantik/Reykjavík]. All other WET locations would follow the same time zone arrangements as one of those two.

标签: go timezone
0条回答
登录 后发表回答