-
Notifications
You must be signed in to change notification settings - Fork 18k
time: (Time).Zone() returns empty timezone string "" on Darwin and "UTC" on Linux after UnmarshalText("9066-03-06T6:05:06Z") or using any valid year #45909
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
By the way, the problem persists even with any valid year range e.g. 2020, 2021 etc. |
I can't recreate this on the darwin-amd64-11 gomote.
|
My uname information is: $ uname -a
Darwin Emmanuels-MacBook-Pro-2.local 19.6.0 Darwin Kernel Version 19.6.0: Thu Jun 18 20:49:00 PDT 2020; root:xnu-6153.141.1~1/RELEASE_X86_64 x86_64 |
Also worked as expected for me on the Darwin 10.15 gomote. I'm not sure what is happening here. |
@odeke-em is
|
Timed out in state WaitingForInfo. Closing. (I am just a bot, though. Please speak up if this is a mistake or you have the requested information.) |
I face the same issue. The zone is "". Please see here : https://go.dev/play/p/677G6V48r6s
|
@sourabhswain That program is behaving as documented. Quoting https://pkg.go.dev/time#Parse
|
What version of Go are you using (
go version
)?Go1.17, Go1.16, Go1.15 the rest I haven't tested
Does this issue reproduce with the latest release?
Yes!
What operating system and processor architecture are you using (
go env
)?Alternating between Darwin and Linux
What did you do?
Looking a bug reported from oss-fuzz that just came from a reflection check failure when the location of a time parsed from
"9066-03-06T6:05:06-00:00" via UnmarshalText and round trip MarshalText then UnmarshalText again per https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=33092&q=label%3AProj-golang
while digging more, I ran https://play.golang.org/p/ealMZGPl7NX or inlined below
What did you expect to see?
On both Linux and Darwin, I expected to see at the end
What did you see instead?
On Linux, I correctly at the end see
on Darwin, I see only
The text was updated successfully, but these errors were encountered: