Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
time: notice system timezone changes #28020
What version of Go are you using (
I haven't (yet) written C to test it, but my current understanding is:
localtime(3) and friends cache values on first use. tzset(3) reloads the cache. So libc enables one to easily handle this in the app; Go doesn't. (And, IMHO, Go should aim higher than libc.)
glibc argument for not stat(2)ing /etc/localtime on every localtime(3) call was performance. inotify and friends might change that equation.
Go pins time.Local at the start of the binary (golang/go#28020), but because the bar can run for days on end even as the machine moves around the world, we need to track the machine timezone for local clock modules. This changes clock.Module to handle a nil timezone as "true" machine-local time zone, updating the output any time the timezone changes locally.