Documentation
¶
Overview ¶
Package timezones builds new time.Locations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewLocation ¶
NewLocation creates a new time.Location from the template.
Types ¶
type Change ¶
type Change struct {
// Start is time when the previous zone changes to ZoneIndex.
Start time.Time
// ZoneIndex which takes effect since Start.
// Must be in range 0 to len(Zones)-1.
ZoneIndex int
}
Change describes a change from one Zone to another.
type Template ¶
type Template struct {
// Name of the new location.
Name string
// Zones lists local zones.
// At the beginning of time, Zone at index 0 applies.
// When that zone changes to another zone is specified in Changes.
// Maximum of 254 zones can be present.
Zones []Zone
// Changes specifies zone transitions.
// Changes Start times must be in strictly increasing order.
// If Extend is non-empty, the ZoneIndex of the last Change is ignored, Extend is used instead.
// Changes might be empty, in that case Extend must be non-empty.
Changes []Change
// If Extend is non-empty, it replaces the definition of zones since the last change.
// If there is at most one zone specified by Zones and Changes, Extend applies since the beginning of time.
// Extend is a TZ string conforming to RFC 8536, section 3.3.
Extend string
}
Template describes how to build a time.Location.
Click to show internal directories.
Click to hide internal directories.