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
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
time: parsing zoneinfo files with no transition times causes lookup() to provide UTC #4064
--- Overview: time.LoadLocation() on POSIX systems eventually uses loadZoneData() in zoneinfo_read.go to parse a zoneinfo file for timezone data. When the zoneinfo file doesn't contain any timezone transition data -- see, for example, "Etc/GMT+4" -- this causes calls to Location.lookup() to return UTC times (line 104, zoneinfo.go). Since FixedZone() creates a Location with a single fake transition (line 86, zoneinfo.go), it seems like the "best" solution here is to do the same for zoneinfo files that are also fixed. I've attached a patch to this bug report, I'd have submitted it for review but mercurial on Goobuntu is Too Damn Old to run the codereview plugin :-/ --- What steps will reproduce the problem? An example that *should* work is here: http://play.golang.org/p/0OqoIdw3gk Unfortunately play.golang.org doesn't have timezone data available. It works when 'go run' --- What is the expected output? Time is: 2004-03-02 13:14:15 +0000 UTC Time in GMT+4 is: 2004-03-02 09:14:15 -0400 GMT+4 --- What do you see instead? Time is: 2004-03-02 13:14:15 +0000 UTC Time in GMT+4 is: 2004-03-02 13:14:15 +0000 UTC --- Which compiler are you using (5g, 6g, 8g, gccgo)? 6g --- Which operating system are you using? Various debian-based linuxes (found the bug at home, reported it from work) --- Which version are you using? (run 'go version') go 1.0.2