The time zone rule abbreviation, e.g. CEST for Central European Summer Time. Note this is dependent on the time, because with time different rules are in effect and therefore different abbreviations. They also change with DST: e.g. CEST or CET.
IANA zone name
Timestamp in UTC unix milliseconds
(default true) set to false for a DST-agnostic abbreviation
The abbreviation of the rule that is in effect
timezonecomplete.NotFound.Zone if zone name not found or a linked zone not found
timezonecomplete.InvalidTimeZoneData if values in the time zone database are invalid
DEPRECATED because DST offset depends on the zone too, not just on the ruleset Returns the DST offset (WITHOUT the standard zone offset) for the given ruleset and the given UTC timestamp
name of ruleset
UTC timestamp
Standard offset without DST for the time zone
timezonecomplete.NotFound.Rule if ruleName not found
timezonecomplete.InvalidTimeZoneData if an error is discovered in the time zone database
Returns the rule set with the given rule name, sorted by first effective date (uncompensated for "w" or "s" AtTime)
Name of rule set
RuleInfo array. Do not change, this is a cached value.
timezonecomplete.NotFound.Rule if rule not found
timezonecomplete.InvalidTimeZoneData for invalid values in the time zone database
DEPRECATED because DST offset depends on the zone too, not just on the ruleset Return a list of all transitions in [fromYear..toYear] sorted by effective date
Name of the rule set
first year to return transitions for
Last year to return transitions for
Standard offset without DST for the time zone
Transitions, with DST offsets (no standard offset included)
timezonecomplete.Argument.FromYear if fromYear > toYear
timezonecomplete.NotFound.Rule if ruleName not found
timezonecomplete.InvalidTimeZoneData if an error is discovered in the time zone database
Return both zone and rule changes as total (std + dst) offsets. Adds an initial transition if there is none within the range.
IANA zone name
First year to include
Last year to include
timezonecomplete.Argument.FromYear if fromYear > toYear
timezonecomplete.NotFound.Zone if zoneName not found
timezonecomplete.InvalidTimeZoneData if an error is discovered in the time zone database
Get the zone info for the given UTC timestamp. Throws if not found.
IANA time zone name
UTC time stamp as unix milliseconds or as a TimeStruct
ZoneInfo object. Do not change, we cache this object.
timezonecomplete.NotFound.Zone if zone name not found or a linked zone not found
timezonecomplete.InvalidTimeZoneData if values in the time zone database are invalid
Return the zone records for a given zone name sorted by UNTIL, after following any links.
IANA zone name like "Pacific/Efate"
Array of zone infos. Do not change, this is a cached value.
timezonecomplete.NotFound.Zone if zone does not exist or a linked zone does not exit
Returns the time zone letter for the given ruleset and the given UTC timestamp
name of ruleset
UTC timestamp as TimeStruct or unix millis
Standard offset without DST for the time zone
timezonecomplete.NotFound.Rule if ruleName not found
timezonecomplete.InvalidTimeZoneData if an error is discovered in the time zone database
Maximum DST offset (which excludes standard offset) of all rules in the database. Note that DST offsets need not be whole hours.
Returns 0 if zoneName given and no DST observed.
Optional
zoneName: string(optional) if given, the result for the given zone is returned
timezonecomplete.NotFound.Zone if zone name not found or a linked zone not found
timezonecomplete.InvalidTimeZoneData if values in the time zone database are invalid
Minimum non-zero DST offset (which excludes standard offset) of all rules in the database. Note that DST offsets need not be whole hours.
Does return zero if a zoneName is given and there is no DST at all for the zone.
Optional
zoneName: string(optional) if given, the result for the given zone is returned
timezonecomplete.NotFound.Zone if zone name not found or a linked zone not found
timezonecomplete.InvalidTimeZoneData if values in the time zone database are invalid
First DST change moment AFTER the given UTC date in UTC milliseconds, within one year, returns undefined if no such change
timezonecomplete.NotFound.Zone if zone name not found or a linked zone not found
timezonecomplete.InvalidTimeZoneData if values in the time zone database are invalid
Normalizes non-existing local times by adding/subtracting a forward offset change. During a forward standard offset change or DST offset change, some amount of local time is skipped. Therefore, this amount of local time does not exist. This function adds the amount of forward change to any non-existing time. After all, this is probably what the user meant.
IANA time zone name
A local time as a unix millisecond value
Optional
opt: NormalizeOption(optional) Round up or down? Default: up.
The normalized time, in the same format as the localTime parameter (TimeStruct or unix millis)
timezonecomplete.NotFound.Zone if zone name not found or a linked zone not found
timezonecomplete.InvalidTimeZoneData if values in the time zone database are invalid
Normalizes non-existing local times by adding/subtracting a forward offset change. During a forward standard offset change or DST offset change, some amount of local time is skipped. Therefore, this amount of local time does not exist. This function adds the amount of forward change to any non-existing time. After all, this is probably what the user meant.
IANA time zone name
A local time, as a TimeStruct
Optional
opt: NormalizeOption(optional) Round up or down? Default: up.
The normalized time, in the same format as the localTime parameter (TimeStruct or unix millis)
timezonecomplete.NotFound.Zone if zone name not found or a linked zone not found
timezonecomplete.InvalidTimeZoneData if values in the time zone database are invalid
Get the day number from an ON column string, 0 if no day.
nothing
Returns the standard time zone offset from UTC, without DST. Throws if info not found.
IANA time zone name
Timestamp in UTC, either as TimeStruct or as Unix millisecond value
timezonecomplete.NotFound.Zone if zone name not found or a linked zone not found
timezonecomplete.InvalidTimeZoneData if values in the time zone database are invalid
Returns the standard time zone offset from UTC, excluding DST, at the given LOCAL timestamp, again excluding DST.
If the local timestamp exists twice (as can occur very rarely due to zone changes) then the first occurrence is returned.
Throws if zone info not found.
IANA time zone name
Timestamp in time zone time
timezonecomplete.NotFound.Zone if zoneName not found
timezonecomplete.InvalidTimeZoneData if an error is discovered in the time zone database
Returns the total time zone offset from UTC, including DST, at the given UTC timestamp. Throws if zone info not found.
IANA time zone name
Timestamp in UTC, either as TimeStruct or as Unix millisecond value
timezonecomplete.NotFound.Zone if zone name not found or a linked zone not found
timezonecomplete.InvalidTimeZoneData if values in the time zone database are invalid
Returns the total time zone offset from UTC, including DST, at the given LOCAL timestamp. Non-existing local time is normalized out. There can be multiple UTC times and therefore multiple offsets for a local time namely during a backward DST change. This returns the FIRST such offset. Throws if zone info not found.
IANA time zone name
Timestamp in time zone time
timezonecomplete.NotFound.Zone if zoneName not found
timezonecomplete.InvalidTimeZoneData if an error is discovered in the time zone database
Static
init(re-) initialize timezonecomplete with time zone data
Optional
data: anyTZ data as JSON object (from one of the tzdata NPM modules). If not given, Timezonecomplete will search for installed modules.
timezonecomplete.InvalidTimeZoneData if data
or the global time zone data is invalid
Static
instanceSingle instance of this database
timezonecomplete.InvalidTimeZoneData if the global time zone data is invalid
This class is a wrapper around time zone data JSON object from the tzdata NPM module. You usually do not need to use this directly, use TimeZone and DateTime instead.