Last active
December 16, 2015 17:29
-
-
Save apalmblad/5470791 to your computer and use it in GitHub Desktop.
go TZ issue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"time" | |
) | |
func main() { | |
tz, err := time.LoadLocation("Atlantic/South_Georgia") | |
if err != nil { | |
fmt.Println(err) | |
} | |
if tz != nil { | |
fmt.Println("Got TZ:", tz) | |
} else { | |
fmt.Println("TZ not received.") | |
} | |
fmt.Println(time.Now().In(tz).Format("3:04 PM MST"), tz) | |
} | |
// expected result: something like a time matching `zdump /usr/share/zoneinfo/Atlantic/South_Georgia` | |
// instead, UTC seems to be in use | |
// go version go1.0.3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment