DO NOT USE THIS CLASS DIRECTLY, USE TimeZone

See http://www.cstdbill.com/tzdb/tz-how-to.html First, and somewhat trivially, whereas Rules are considered to contain one or more records, a Zone is considered to be a single record with zero or more continuation lines. Thus, the keyword, “Zone,” and the zone name are not repeated. The last line is the one without anything in the [UNTIL] column. Second, and more fundamentally, each line of a Zone represents a steady state, not a transition between states. The state exists from the date and time in the previous line’s [UNTIL] column up to the date and time in the current line’s [UNTIL] column. In other words, the date and time in the [UNTIL] column is the instant that separates this state from the next. Where that would be ambiguous because we’re setting our clocks back, the [UNTIL] column specifies the first occurrence of the instant. The state specified by the last line, the one without anything in the [UNTIL] column, continues to the present. The first line typically specifies the mean solar time observed before the introduction of standard time. Since there’s no line before that, it has no beginning. 8-) For some places near the International Date Line, the first two lines will show solar times differing by 24 hours; this corresponds to a movement of the Date Line. For example:

Zone NAME GMTOFF RULES FORMAT [UNTIL]

Zone America/Juneau 15:02:19 - LMT 1867 Oct 18 -8:57:41 - LMT ... When Alaska was purchased from Russia in 1867, the Date Line moved from the Alaska/Canada border to the Bering Strait; and the time in Alaska was then 24 hours earlier than it had been.

The abbreviation, “LMT,” stands for “local mean time,” which is an invention of the tz database and was probably never actually used during the period. Furthermore, the value is almost certainly wrong except in the archetypal place after which the zone is named. (The tz database usually doesn’t provide a separate Zone record for places where nothing significant happened after 1970.)

Constructors

Properties

format: string

The FORMAT column specifies the usual abbreviation of the time zone name. It can have one of four forms: the string, “zzz,” which is a kind of null value (don’t ask) a single alphabetic string other than “zzz,” in which case that’s the abbreviation a pair of strings separated by a slash (‘/’), in which case the first string is the abbreviation for the standard time name and the second string is the abbreviation for the daylight saving time name a string containing “%s,” in which case the “%s” will be replaced by the text in the appropriate Rule’s LETTER column

gmtoff: Duration

GMT offset in fractional minutes, POSITIVE to UTC (note JavaScript.Date gives offsets contrary to what you might expect). E.g. Europe/Amsterdam has +60 minutes in this field because it is one hour ahead of UTC

ruleName: string

If the rule column is a rule name, this is the rule name

ruleOffset: Duration

If the rule column is an offset, this is the offset

ruleType: RuleType

The RULES column tells us whether daylight saving time is being observed: A hyphen, a kind of null value, means that we have not set our clocks ahead of standard time. An amount of time (usually but not necessarily “1:00” meaning one hour) means that we have set our clocks ahead by that amount. Some alphabetic string means that we might have set our clocks ahead; and we need to check the rule the name of which is the given alphabetic string.

until?: number

Until timestamp in unix utc millis. The zone info is valid up to and excluding this timestamp. Note this value can be undefined (for the first rule)

Generated using TypeDoc