On Mon, Feb 13, 2023 at 7:55 AM 'Thomas Casteleyn' via golang-nuts < golang-nuts@googlegroups.com> wrote:
> Hi Sam, > > While I do acknowledge there might be some timezones that are ambiguous, > it certainly is not the case for CET and MST. IMHO those should be able to > be correctly parsed by time.Parse and time.ParseInLocation. If provided an > ambiguous timezone to time.Parse, that should maybe return an error > instead? time.ParseInLocation should always be able to provide something > meaningful. > The exact definitions and meanings of timezone abbreviations are not standardized. In practice on Unix systems they depend on the specific contents of the tzdata files on your local system. And new abbreviations are introduced from time to time and old one are retired. We aren't going to change the standard library time package as you suggest. If you absolutely must use timezone abbreviations, as opposed to the standardized and well understand hour offsets recommended earlier, then I suggest that you write a preparser to convert your recognized timezone abbreviations into hour offsets. Sorry this isn't very helpful, but it seems like the only portable and consistent approach that we can take. Ian > On Monday, February 13, 2023 at 4:13:37 PM UTC+1 Sam Vilain wrote: > >> >> >> On Feb 13, 2023, at 9:55 AM, Sven Rebhan <sre...@influxdata.com> wrote: >> >> I do not yet see where timezone abbreviations are ambiguous... Do you >> mean there are multiple timezones with the same abbrev? This is certainly >> not the case for MST... >> What is the point in taking the timezone into account only if that >> timezone is in the local timezone? I really wish there would be a way to >> handle abbreviations exactly >> the same as numeric offsets as the offset to UTC should be known for the >> abbreviations, shouldn't they? >> >> >> Yeah, there’s quite a few. The first time I looked at Olson there was >> only some overlap between Australia and the US (both claiming “Eastern >> Time” as their own territory, which as British Kiwi I found somewhat >> amusing). >> >> CDT could be Cuba (-4) or Central (-5) Daylight Time >> EST could be New York (-5) or Sydney (+10) >> AST could be Bermuda (-4) or Bahrain (+3) >> >> See more for yourself on >> [image: tadlogo-facebook.png] >> >> Time Zone Abbreviations - Worldwide List >> <https://www.timeanddate.com/time/zones/> >> timeanddate.com <https://www.timeanddate.com/time/zones/> >> <https://www.timeanddate.com/time/zones/> >> >> Sam >> > -- > You received this message because you are subscribed to the Google Groups > "golang-nuts" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to golang-nuts+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/golang-nuts/1e2e9e76-ee5d-446c-94bd-53f5896e16f0n%40googlegroups.com > <https://groups.google.com/d/msgid/golang-nuts/1e2e9e76-ee5d-446c-94bd-53f5896e16f0n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CAOyqgcWjeOipQxX_S0RKE%3DgT2OwkiMnGB%2BAzY%2BO4Xg%3DVPm%3DoZQ%40mail.gmail.com.