Timezone markup in a location structure in Go

For a timezone like EDT or CEST, is there a way to get the link time.Locationto use it with func (t Time) In(loc *Location) Time?

You can initialize the location, for example. CEST c time.LoadLocation("Europe/Berlin"), but how to do the same to indicate the current time zone?

Given a very insightful comment from @Svip, is there any reasonable way to return a list of representative locations? That is, to return WET, for example. [Europe/London, Atlantik/ReykjavΓ­k]. All other locations WETwill correspond to the same time zones as one of these two.

0
source share

Source: https://habr.com/ru/post/1694401/


All Articles