Timezone data.

Methods

inline at (utc:DateTime):DateTime

Find out what was the date/time at specified UTC time in this timezone

E.g.

var utc = DateTime.fromString('2012-01-01 00:00:00');

var tz = Timezone.get('Europe/Moscow');

tz.at(utc).toString(); // 2012-01-01 04:00:00

inline format (utc:DateTime, format:String):String

Make a string according to format.

  • %z The time zone offset. Example: -0500 for US Eastern Time
  • %Z The time zone abbreviation. Example: EST for Eastern Standart Time
  • %q ISO8691 date/time format. Example: 2014-10-04T19:42:56+00:00

After timezone placeholders in format are processed at(utc).format(format) is called.

inline getAbbreviation (utc:DateTime):String

Get timezone abbreviation at specified moment. E.g. EST for Eastern Standart Time

getAllPeriods ():Array<TZPeriod>

Build an array of all periods between time switches in this zone

inline getHHMM (utc:DateTime):Int

Get time offset relative to UTC time at specified moment in HHMM format.

inline getName ():String

Get timezone name

inline getOffset (utc:DateTime):Int

Get time offset relative to UTC time at specified moment.

*   Returns amount of seconds.

getPeriodForLocal (local:DateTime):TZPeriod

Find appropriate period between time changes for specified local local time

getPeriodForUtc (utc:DateTime):TZPeriod

Find appropriate period between time changes for specified utc time

inline isDst (utc:DateTime):Bool

Check if Daylight Saving time is in effect in this zone at utc time

toString ():String

Description

inline utc (local:DateTime):DateTime

Convert local time in this timezone to utc

Static methods

staticinline get (name:String):Null<Timezone>

Get timezone by IANA timezone name

staticinline getZonesList ():Array<String>

Build available timezones list

staticloadData (data:String):Void

Set/overwrite existing timezone database with data loaded from external source. Use this method if you load timezone database from external source at runtime. You can compile with -D EXTERNAL_TZ_DB to avoid embedding timezone databaze at compile time.

staticlocal ():Timezone

Get local timezone on current machine. If timezone cannot be detected, returns UTC zone