-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
time: time.Local is always UTC on iOS #20797
Comments
I'll work on it next week. |
This adds a dependency to cgo in the time package which is against policy enforced by go/build/deps_test.go and breaks the test. |
I'd rather avoid modifying the policy for certain ports. Maybe we can put this in another package (runtime?) and use it from time. That's kinda gross too, though. @rsc, preferences? |
Not this cycle. |
Pinging for a decision on how to proceed here. |
@tmm1, I'm not sure anybody's thought about it. It'd be nice to see something that works first, and then we can see how gross it ends up, and where we might shove that grossness. Or maybe it'll look fine. /cc @eliasnaur @bcmills |
@gwik It sounded like you had a patch for this which was breaking deps_test.go. Care to open a CL with it? |
/cc @eliasnaur too |
Ping for this issue, curious if anyone has thought about it, or if it is just lost. It's not the end of the world (can just call the right functions directly), but would be nice for Go to do something more useful on these platforms. |
It is disappointed that this is still an issue since two years.
Hope Gomobile can be better in the future. |
The correct fix is not as easy as it sounds because of cgo restrictions, see above. One easier workaround is to do the timezone setting on gomobile itself, not the Go runtime. I encourage anyone interested in fixing this issue to try that, if for nothing else than the runtime fix will not be released until Go 1.15 in August next year. That said, @gwik's original approach might be feasible without Cgo now that Go uses libc on Darwin. |
This solution works for me, but needs build with |
Local timezone is hardcoded to UTC on iOS.
https://github.com/golang/go/blob/master/src/time/zoneinfo_ios.go#L39-L42
As mentioned in the code it should use NSTimeZone localTimeZone to get the current timezone.
cc @eliasnaur @crawshaw
(Same issue on android #20455)
The text was updated successfully, but these errors were encountered: