Documentation ¶
Overview ¶
timezone is a static list of timezones. It is incomplete as of now. Eventually it will be autogenerated using the approach as shown https://stackoverflow.com/questions/40120056/get-a-list-of-valid-time-zones-in-go
Index ¶
- Constants
- func DefaultZoneDirs() []string
- func LoadLocationByAbbreviation(tzAbbr, tzName string) (*time.Location, error)
- func LoadLocationsByAbbreviation(tzAbbr, tzName string) []*time.Location
- func ZoneOffsetSeconds(dt time.Time, ianaTimeZoneName string) (int, error)
- func ZonesPortable() []string
- func ZonesSystem(zoneDirs []string) []string
Constants ¶
const ( TimezoneAmericaChicago = "America/Chicago" TimezoneAmericaLosAngeles = "America/Los_Angeles" )
const ( DefaultZoneDirsString = "/usr/share/zoneinfo/,/usr/share/lib/zoneinfo/,/usr/lib/locale/TZ/" PortableZones = `` /* 10049-byte string literal not displayed */ )
Variables ¶
This section is empty.
Functions ¶
func DefaultZoneDirs ¶
func DefaultZoneDirs() []string
func LoadLocationByAbbreviation ¶ added in v0.40.7
LoadLocationByAbbreviation returns a `*time.Location` given a timezone abbreviation and name. For example: ("PST", "Pacific Standard Time"). If the abbreviation only represents one timezone the timezone name can be omitted. An error is returned if more than one location is present. This is a wrapper for `github.com/tkuchiki/go-timezone` which defines the timezone abbreviation and names.
func LoadLocationsByAbbreviation ¶ added in v0.40.7
LoadLocationsByAbbreviation loads all the matching locations by timezone abbreviation and name. Errors are returned as an empty slice.
func ZoneOffsetSeconds ¶
ZoneOffsetSeconds is used like ZoneOffsetSeconds(time.Now(), "America/New_York")
func ZonesPortable ¶
func ZonesPortable() []string
func ZonesSystem ¶
GetZones treturns a list of timezones.
Types ¶
This section is empty.
Directories ¶
Path | Synopsis |
---|---|
examples
|
|
build_constants
main this code was sourced from Stack Overflow here: https://stackoverflow.com/a/40130882/1908967
|
main this code was sourced from Stack Overflow here: https://stackoverflow.com/a/40130882/1908967 |