DO NOT USE THIS CLASS DIRECTLY, USE TimeZone

See http://www.cstdbill.com/tzdb/tz-how-to.html

Constructors

  • Constructor

    Parameters

    • from: number
    • toType: ToType
    • toYear: number
    • type: string
    • inMonth: number
    • onType: OnType
    • onDay: number
    • onWeekDay: WeekDay
    • atHour: number
    • atMinute: number
    • atSecond: number
    • atType: AtType
    • save: Duration
    • letter: string

    Returns RuleInfo

    Throws

    nothing

Properties

atHour: number

AT column hour

atMinute: number

AT column minute

atSecond: number

AT column second

atType: AtType

AT column type

from: number

FROM column year number.

inMonth: number

IN column month number 1-12

letter: string

Character to insert in %s for time zone abbreviation Note if TZ database indicates "-" this is the empty string

onDay: number

If onType is DayNum, the day number

onType: OnType

ON column type

onWeekDay: WeekDay

If onType is not DayNum, the weekday

save: Duration

DST offset from local standard time (NOT from UTC!)

toType: ToType

TO column type: Year for year numbers and "only" values, Max for "max" value.

toYear: number

If TO column is a year, the year number. If TO column is "only", the FROM year.

type: string

TYPE column, not used so far

Methods

  • Returns true iff this rule is applicable in the year

    Parameters

    • year: number

    Returns boolean

    Throws

    nothing

  • Returns the year-relative date that the rule takes effect. Depending on the rule this can be a UTC time, a wall clock time, or a time in standard offset (i.e. you still need to compensate for this.atType)

    Parameters

    • year: number

    Returns TimeStruct

    Throws

    timezonecomplete.NotApplicable if this rule is not applicable in the given year

  • Effective date in UTC in the given year, in a specific time zone

    Parameters

    • year: number
    • standardOffset: Duration

      the standard offset from UT of the time zone

    • dstOffset: undefined | Duration

      the DST offset before the rule

    Returns TimeStruct

  • Sort comparison

    Parameters

    Returns boolean

    (first effective date is equal to other's first effective date)

    Throws

    timezonecomplete.InvalidTimeZoneData for invalid internal structure of the database

  • Sort comparison

    Parameters

    Returns boolean

    (first effective date is less than other's first effective date)

    Throws

    timezonecomplete.InvalidTimeZoneData if this rule depends on a weekday and the weekday in question doesn't exist

Generated using TypeDoc