PackageTop Level
Classpublic class TimeZone
InheritanceTimeZone Inheritance Object

Language version: ActionScript 3.0
Runtime version: AIR 50

The TimeZone class provides information about timezones that can be used in date calculations and to find out about different locations and their time zone offsets. The information available will vary according to the operating system being used as the time zone objects are created based on APIs that are made available by the device OS.

To list available time zones, use the TimeZone.availableTimeZoneNames property which will be initialized on first use by the operating system. Strings that are available here can then be used to create a TimeZone object using the TimeZone.getTimeZone method.



Public Properties
 PropertyDefined by
  availableTimeZoneNames : Vector.<String>
[static][read-only] Retrieves a list of the available time zone names that can be used on this operating system.
TimeZone
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
  daylightSavingsOffset : int
[read-only] The offset between this time zone and UTC during daylight savings, in milliseconds.
TimeZone
  displayName : String
[read-only] The display name of this time zone.
TimeZone
 Inheritedprototype : Object
[static] A reference to the prototype object of a class or function object.
Object
  rawOffset : int
[read-only] The standard offset between this time zone and UTC, in milliseconds.
TimeZone
  usesDaylightSavings : Boolean
[read-only] Whether this time zone has a daylight savings change.
TimeZone
Public Methods
 MethodDefined by
  
The time offset between this timezone and UTC, for a particular (UTC) date.
TimeZone
  
getTimeZone(timeZoneName:String):TimeZone
[static] Obtains a TimeZone object using a string that is found in the list of availableTimeZoneNames.
TimeZone
 Inherited
Indicates whether an object has a specified property defined.
Object
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
 Inherited
Returns the string representation of this object, formatted according to locale-specific conventions.
Object
 Inherited
Returns the string representation of the specified object.
Object
 Inherited
Returns the primitive value of the specified object.
Object
Property detail
availableTimeZoneNamesproperty
availableTimeZoneNames:Vector.<String>  [read-only]

Language version: ActionScript 3.0
Runtime version: AIR 50

Retrieves a list of the available time zone names that can be used on this operating system.

Implementation
    public static function get availableTimeZoneNames():Vector.<String>
daylightSavingsOffsetproperty 
daylightSavingsOffset:int  [read-only]

Language version: ActionScript 3.0
Runtime version: AIR 50

The offset between this time zone and UTC during daylight savings, in milliseconds.

Note: if this time zone does not use daylight savings, this value will be the same as the value of rawOffset.

Implementation
    public function get daylightSavingsOffset():int
displayNameproperty 
displayName:String  [read-only]

Language version: ActionScript 3.0
Runtime version: AIR 50

The display name of this time zone.

Implementation
    public function get displayName():String
rawOffsetproperty 
rawOffset:int  [read-only]

Language version: ActionScript 3.0
Runtime version: AIR 50

The standard offset between this time zone and UTC, in milliseconds.

Implementation
    public function get rawOffset():int
usesDaylightSavingsproperty 
usesDaylightSavings:Boolean  [read-only]

Language version: ActionScript 3.0
Runtime version: AIR 50

Whether this time zone has a daylight savings change.

Implementation
    public function get usesDaylightSavings():Boolean
Method detail
getOffset()method
public function getOffset(date:Date):int

Language version: ActionScript 3.0
Runtime version: AIR 50

The time offset between this timezone and UTC, for a particular (UTC) date.

Note: for any date in UTC format, there should be exactly one match for the offset value. Reversing this process does not always work, for example some local times do not exist due to clocks changing forward, and some local times happen twice due to the clocks changing backwards. Hence to find the correct offset, the input date must be in UTC format.

Parameters
date:Date — The date/time information at which to check the time offset

Returns
int — The offset, in milliseconds, between GMT and local time at the given date.
getTimeZone()method 
public static function getTimeZone(timeZoneName:String):TimeZone

Language version: ActionScript 3.0
Runtime version: AIR 50

Obtains a TimeZone object using a string that is found in the list of availableTimeZoneNames. Pass in a null string to get the TimeZone object representing the current location of the device.

Parameters
timeZoneName:String — The name of the time zone to retrieve, or null for the current device time zone.

Returns
TimeZone — The TimeZone object corresponding to the requested time zone

Throws
ArgumentError — If the requested timeZoneName is not a valid name (and isn't null)