tz: Index | Examples | Files

package tz

import ""

Package tz contains time zone info so that you can predictably load Locations regardless of the locations available on the locally running operating system.

The stdlib time.LoadLocation function loads timezone data from the operating system or from in a local Go installation. Both of these are often missing from some operating systems, especially Windows.

This package has the from Go embedded into the package so that queries to load a location always return the same data regardless of operating system.

This package exists because of



Package Files

tz.go zoneinfo.go

func LoadLocation Uses

func LoadLocation(name string) (*time.Location, error)


t := time.Date(2009, time.November, 10, 23, 0, 0, 0, time.UTC)

syd, _ := tz.LoadLocation("Australia/Sydney")


2009-11-10 23:00:00 +0000 UTC
2009-11-11 10:00:00 +1100 AEDT

Package tz imports 2 packages (graph) and is imported by 6 packages. Updated 2019-03-15. Refresh now. Tools for package owners.