Skip to content

Instantly share code, notes, and snippets.

@apalmblad
Last active December 16, 2015 17:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save apalmblad/5470791 to your computer and use it in GitHub Desktop.
Save apalmblad/5470791 to your computer and use it in GitHub Desktop.
go TZ issue
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