Allow not using instanceof
Zone abbreviation at given UTC timestamp e.g. CEST for Central European Summer Time.
Optional
year: numberFull year
Optional
month: numberMonth 1-12 (note this deviates from JavaScript date)
Optional
day: numberDay of month 1-31
Optional
hour: numberHour 0-23
Optional
minute: numberMinute 0-59
Optional
second: numberSecond 0-59
Optional
milli: numberOptional
dstDependent: boolean(default true) set to false for a DST-agnostic abbreviation
"local" for local timezone, the offset for an offset zone, or the abbreviation for a proper zone.
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
Zone abbreviation at given UTC timestamp e.g. CEST for Central European Summer Time.
Optional
dstDependent: booleantimezonecomplete.NotFound.Zone if zone name not found or a linked zone not found
timezonecomplete.InvalidTimeZoneData if values in the time zone database are invalid
Equality operator. Maps zero offsets and different names for UTC onto each other. Other time zones are not mapped onto each other.
timezonecomplete.InvalidTimeZoneData if the global time zone data is invalid
Returns true iff the constructor arguments were identical, so UTC !== GMT
nothing
The kind of time zone (Local/Offset/Proper)
nothing
Normalizes non-existing local times by adding 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.
Optional
opt: NormalizeOption(optional) Round up or down? Default: up
unix milliseconds in zone time, normalized.
timezonecomplete.InvalidTimeZoneData if values in the time zone database are invalid
Normalizes non-existing local times by adding 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.
zone time timestamp
Optional
opt: NormalizeOption(optional) Round up or down? Default: up
time struct in zone time, normalized.
timezonecomplete.InvalidTimeZoneData if values in the time zone database are invalid
Calculate timezone offset including DST from a UTC time.
the offset of this time zone with respect to UTC at the given time, in minutes.
timezonecomplete.InvalidTimeZoneData if values in the time zone database are invalid
Calculate timezone offset including DST from a UTC time.
Optional
year: numberOptional
month: number1-12
Optional
day: numberOptional
hour: numberOptional
minute: numberOptional
second: numberOptional
milli: numberthe offset of this time zone with respect to UTC at the given time, in minutes.
timezonecomplete.Argument.Year for invalid year
timezonecomplete.Argument.Month for invalid month
timezonecomplete.Argument.Day for invalid day
timezonecomplete.Argument.Hour for invalid hour
timezonecomplete.Argument.Minute for invalid minute
timezonecomplete.Argument.Second for invalid second
timezonecomplete.Argument.Milli for invalid milliseconds
timezonecomplete.InvalidTimeZoneData if values in the time zone database are invalid
Note: will be removed in version 2.0.0
Convenience function, takes values from a Javascript Date Calls offsetForUtc() with the contents of the date
timezonecomplete.InvalidTimeZoneData if values in the time zone database are invalid
Calculate timezone offset from a zone-local time (NOT a UTC time).
the local time
the offset of this time zone with respect to UTC at the given time, in minutes.
timezonecomplete.InvalidTimeZoneData if values in the time zone database are invalid
Calculate timezone offset from a zone-local time (NOT a UTC time).
Optional
year: numberlocal full year
Optional
month: numberlocal month 1-12 (note this deviates from JavaScript date)
Optional
day: numberlocal day of month 1-31
Optional
hour: numberlocal hour 0-23
Optional
minute: numberlocal minute 0-59
Optional
second: numberlocal second 0-59
Optional
milli: numberthe offset of this time zone with respect to UTC at the given time, in minutes.
timezonecomplete.Argument.Year for invalid year
timezonecomplete.Argument.Month for invalid month
timezonecomplete.Argument.Day for invalid day
timezonecomplete.Argument.Hour for invalid hour
timezonecomplete.Argument.Minute for invalid minute
timezonecomplete.Argument.Second for invalid second
timezonecomplete.Argument.Milli for invalid milliseconds
timezonecomplete.InvalidTimeZoneData if values in the time zone database are invalid
Note: will be removed in version 2.0.0
Convenience function, takes values from a Javascript Date Calls offsetForUtc() with the contents of the date
timezonecomplete.InvalidTimeZoneData if values in the time zone database are invalid
Calculate timezone standard offset excluding DST from a UTC time.
the standard offset of this time zone with respect to UTC at the given time, in minutes.
timezonecomplete.InvalidTimeZoneData if values in the time zone database are invalid
Calculate timezone standard offset excluding DST from a UTC time.
Optional
year: numberOptional
month: number1-12
Optional
day: numberOptional
hour: numberOptional
minute: numberOptional
second: numberOptional
milli: numberthe standard offset of this time zone with respect to UTC at the given time, in minutes.
timezonecomplete.Argument.Year for invalid year
timezonecomplete.Argument.Month for invalid month
timezonecomplete.Argument.Day for invalid day
timezonecomplete.Argument.Hour for invalid hour
timezonecomplete.Argument.Minute for invalid minute
timezonecomplete.Argument.Second for invalid second
timezonecomplete.Argument.Milli for invalid milliseconds
timezonecomplete.InvalidTimeZoneData if values in the time zone database are invalid
Static
localStatic
offsetConvert an offset number into an offset string
The offset in minutes from UTC e.g. 90 minutes
the offset in ISO notation "+01:30" for +90 minutes
Argument.Offset if offset is not a finite number or not within -24 * 60 ... +24 * 60 minutes
Static
stringStatic
utcStatic
zoneTime zone with a fixed offset
offset w.r.t. UTC in minutes, e.g. 90 for +01:30
timezonecomplete.Argument.Offset if the offset is not within -24h...+24h (in minutes)
Time zone for an offset string or an IANA time zone string. Note that time zones are cached so you don't necessarily get a new object each time.
"localtime" for local time, a TZ database time zone name (e.g. Europe/Amsterdam), or an offset string (either +01:30, +0130, +01, Z). For a full list of names, see: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones TZ database zone name may be suffixed with " without DST" to indicate no DST should be applied. In that case, the dst parameter is ignored.
Optional
dst: booleanOptional, default true: adhere to Daylight Saving Time if applicable. Note for "localtime", timezonecomplete will adhere to the computer settings, the DST flag does not have any effect.
timezonecomplete.Argument.S if s cannot be parsed
timezonecomplete.NotFound.Zone if the zone name doesn't exist in the time zone database
Time zone. The object is immutable because it is cached: requesting a time zone twice yields the very same object. Note that we use time zone offsets inverted w.r.t. JavaScript Date.getTimezoneOffset(), i.e. offset 90 means +01:30.
Time zones come in three flavors: the local time zone, as calculated by JavaScript Date, a fixed offset ("+01:30") without DST, or a IANA timezone ("Europe/Amsterdam") with DST applied depending on the time zone rules.