README ¶ tzdata Embeddable timezone database for Go projects Build go get -d github.com/bcicen/tzdata && \ cd ${GOPATH}/github.com/bcicen/tzdata && \ go generate Usage Once the timezone data is built, it may be used in place of time.LoadLocation(): package main import ( "fmt" "time" "github.com/bcicen/tzdata" ) func main() { loc, _ := tzdata.Load("America/New_York") fmt.Println(time.Now().In(loc)) } Expand ▾ Collapse ▴ Documentation ¶ Index ¶ Variables func Load(name string) (*time.Location, error) func Preload() Constants ¶ This section is empty. Variables ¶ View Source var ( Built = "" // LocationNames contains all available timezone names LocationNames = allLocations() ) Functions ¶ func Load ¶ func Load(name string) (*time.Location, error) Load a timezone Location by name from the embedded tz database func Preload ¶ func Preload() Uncompress and load all timezone data into memory for quicker access Types ¶ This section is empty. Source Files ¶ View all Source files main.go Directories ¶ Show internal Expand all Path Synopsis util Click to show internal directories. Click to hide internal directories.