go-playground / locales

:earth_americas: a set of locales generated from the CLDR Project which can be used independently or within an i18n package; these were built for use with, but not exclusive to https://github.com/go-playground/universal-translator
MIT License
268 stars 55 forks source link

Timezone ambiguity #17

Open fmovlex opened 6 years ago

fmovlex commented 6 years ago

Timezone abbrivations are (sadly) not unique, e.g. IST is (Israel/India/Irish) Standard Time. (https://en.wikipedia.org/wiki/List_of_time_zone_abbreviations)

Related issue elsewhere: https://github.com/osTicket/osTicket/issues/3583

Lookup for full time is done by abbreviated name, so this happens:

loc, _ := time.LoadLocation("Asia/Jerusalem")
datetime := time.Date(2016, 02, 03, 9, 0, 1, 0, loc)
l := en_US.New()
fmt.Println(l.FmtTimeFull(datetime)) // 9:00:01 am India Standard Time
deankarn commented 6 years ago

Thanks @fmovlex for reporting, I'll try and think of a way around that; any help or thoughts on how would be appreciated :)