Commit 9bde9b4d authored by Domas Tamašauskas's avatar Domas Tamašauskas Committed by Ian Lance Taylor

time: document an alternative way of setting the system's time zone

User's program was mutating time.Local variable and crashing
itself as a consequence. Instead of documenting that time.Local
variable should not be mutated, recommended way of setting the
system's time zone has been documented.

Fixes #34814

Change-Id: I7781189855c3bf2ea979dfa07f86c283eed27091
Reviewed-on: https://go-review.googlesource.com/c/go/+/200457Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
parent 4ff45821
......@@ -65,6 +65,11 @@ var UTC *Location = &utcLoc
var utcLoc = Location{name: "UTC"}
// Local represents the system's local time zone.
// On Unix systems, Local consults the TZ environment
// variable to find the time zone to use. No TZ means
// use the system default /etc/localtime.
// TZ="" means use UTC.
// TZ="foo" means use file foo in the system timezone directory.
var Local *Location = &localLoc
// localLoc is separate so that initLocal can initialize
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment