TimeZone enumeration and services.
Class TimeZone
This class proves the list of managed timezones and various services needed to handle them.
The enumerative part contains the following constants, representing west, east and some named timezones:
- local: Special local zone (unassigned, but relative to current location).
- W1 to W12 (-1h to -12h)
- NFT
- NONE: No/neutral/unknown timezone.
Methods | |
describe | Returns a descriptive string naming the required timezone. |
getDisplacement | Returns the distance in minutes from the GMT time of a given timezone |
getLocal | Return local time zone code. |
Returns a descriptive string naming the required timezone.
TimeZone.describe( tz )
tz | A time zone code. |
Return | A timezone name. |
This static method, callable directly on the TimeZone class, returns a RFC 2822 compliant timezone name, given a timezone code. The "name" is in the format "+/-hhmm".
Returns the distance in minutes from the GMT time of a given timezone
TimeZone.getDisplacement( tz )
tz | A time zone code. |
Return | A relative time distance in minutes. |
This static method, callable directly on the TimeZone class, returns the time displacement of a determined time zone with respect to GMT.
Return local time zone code.
TimeZone.getLocal()
Return | A time zone code coresponding to the system local timezone. |
To get a descriptive name of local timezone, use:
TimeZone.describe( TimeZone.getLocal() )