Skip to content
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

Open
gwik opened this Issue Jun 26, 2017 · 8 comments

Comments

Projects
None yet
5 participants
@gwik
Copy link
Contributor

gwik commented Jun 26, 2017

Local timezone is hardcoded to UTC on iOS.

https://github.com/golang/go/blob/master/src/time/zoneinfo_ios.go#L39-L42

func initLocal() {
	// TODO(crawshaw): [NSTimeZone localTimeZone]
	localLoc = *UTC
}

As mentioned in the code it should use NSTimeZone localTimeZone to get the current timezone.

cc @eliasnaur @crawshaw

(Same issue on android #20455)

@gwik

This comment has been minimized.

Copy link
Contributor Author

gwik commented Jun 26, 2017

I'll work on it next week.

@ALTree ALTree added this to the Go1.10 milestone Jun 26, 2017

@gwik

This comment has been minimized.

Copy link
Contributor Author

gwik commented Jul 2, 2017

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.

@bradfitz

This comment has been minimized.

Copy link
Member

bradfitz commented Nov 15, 2017

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?

@rsc

This comment has been minimized.

Copy link
Contributor

rsc commented Nov 22, 2017

Not this cycle.

@rsc rsc modified the milestones: Go1.10, Go1.11 Nov 22, 2017

@tmm1

This comment has been minimized.

Copy link
Contributor

tmm1 commented Apr 6, 2018

Pinging for a decision on how to proceed here.

@bradfitz

This comment has been minimized.

Copy link
Member

bradfitz commented Apr 6, 2018

@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

@tmm1

This comment has been minimized.

Copy link
Contributor

tmm1 commented Apr 6, 2018

@gwik It sounded like you had a patch for this which was breaking deps_test.go. Care to open a CL with it?

@bradfitz bradfitz added the mobile label May 30, 2018

@bradfitz

This comment has been minimized.

Copy link
Member

bradfitz commented May 30, 2018

/cc @eliasnaur too

@bradfitz bradfitz modified the milestones: Go1.11, Unplanned May 30, 2018

@bradfitz bradfitz added the NeedsFix label May 30, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.