-
Notifications
You must be signed in to change notification settings - Fork 18k
time: time.LoadLocation reports unknown time zone for European Summer Time #69549
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Duplicate of #34913 |
@seankhliao is it though? I saw that issue and I also see that CEST is not defined within my (or my colleagues) system. But I'm not specifying some unknown timezone myself, I'm just passing on the value returned by |
The time package is just reflecting that time zone information stored on your system. The What we may not have is a way to return the full name of the local timezone. That is actually not recorded in the tzdata on a typical Unix system. You can often find it on a Unix system by calling |
Go version
go version go1.23.0 darwin/arm64
Output of
go env
in your module/workspace:What did you do?
I'm in the Europe/Berlin Timezone, where the daylight savings time is called "CEST" as reported by
time.Now().Zone()
. I also tested with Europe/Bucharest ("EEST").https://go.dev/play/p/_RHfB4rcJzi
What did you see happen?
Running the code right now during daylight savings time yields:
tz: CEST, offset: 7200loc: UTC, err: unknown time zone CEST
. (Please excuse the formatting here, I threw this together quickly.)Running it with the clock set to March 1, and timezone updated to CET accordingly yields:
tz: CET, offset: 3600loc: CET, err: %!s(<nil>)
What did you expect to see?
I should always be able to load a location from a timezone string obtained by
time.Now().Zone()
during Daylight Savings Time the same as during Winter Time. In other words, I would expect the first result to be something like:tz: CEST, offset: 7200loc: CEST, err: %!s(<nil>)
The text was updated successfully, but these errors were encountered: