timezone.js
No description.

File Location

/goog/i18n/timezone.js

Classes

goog.i18n.TimeZone
TimeZone class implemented a time zone resolution and name information source for client applications. The time zone object is initiated from a time zone information object. Application can initiate a time zone statically, or it may choose to initiate from a data obtained from server. Each time zone information array is small, but the whole set of data is too much for client application to download. If end user is allowed to change time zone setting, dynamic retrieval should be the method to use. In case only time zone offset is known, there is a decent fallback that only use the time zone offset to create a TimeZone object. A whole set of time zone information array was available under http://go/js_locale_data. It is generated based on CLDR and Olson time zone data base (through pytz), and will be updated timely.

Public Protected Private

Enumerations

Global Functions

goog.i18n.TimeZone.composeGMTString_(offset) string
Generate a GMT-relative string for a constant time zone offset.
Arguments:
offset : number
The time zone offset in minutes WEST of UTC.
Returns: string  The GMT string for this offset, which will indicate hours EAST of UTC.
code »
goog.i18n.TimeZone.composePosixTimeZoneID_(offset) string
Generate a POSIX time zone ID for a constant time zone offset.
Arguments:
offset : number
The time zone offset in minutes WEST of UTC.
Returns: string  The POSIX time zone ID for this offset, which will indicate hours WEST of UTC.
code »
goog.i18n.TimeZone.composeUTCString_(offset) string
Generate a UTC-relative string for a constant time zone offset.
Arguments:
offset : number
The time zone offset in minutes WEST of UTC.
Returns: string  The UTC string for this offset, which will indicate hours EAST of UTC.
code »
goog.i18n.TimeZone.createSimpleTimeZone_(timeZoneOffsetInMinutes) !goog.i18n.TimeZone
This factory method creates a time zone object with a constant offset.
Arguments:
timeZoneOffsetInMinutes : number
Offset in minutes WEST of UTC.
Returns: !goog.i18n.TimeZone  A time zone object with the given constant offset. Note that the time zone ID of this object will use the POSIX convention, which has a reversed sign ("Etc/GMT+8" means UTC-8 or PST).
code »
goog.i18n.TimeZone.createTimeZone(timeZoneData) !goog.i18n.TimeZone
This factory method creates a time zone instance. It takes either an object containing complete time zone information, or a single number representing a constant time zone offset. If the latter form is used, DST functionality is not available.
Arguments:
timeZoneData : number | Object
If this parameter is a number, it should indicate minutes WEST of UTC to be used as a constant time zone offset. Otherwise, it should be an object with these four fields:
  • id: A string ID for the time zone.
  • std_offset: The standard time zone offset in minutes EAST of UTC.
  • names: An array of four names (standard short name, standard long name, daylight short name, daylight long, name)
  • transitions: An array of numbers which are interpreted in pairs: [time1, adjustment1, time2, adjustment2, ...] where each time is a DST transition point given as a number of hours since 00:00 UTC, January 1, 1970, and each adjustment is the adjustment to apply for times after the DST transition, given as minutes EAST of UTC.
Returns: !goog.i18n.TimeZone  A goog.i18n.TimeZone object for the given time zone data.
code »

Directory i18n

File Reference