i18n.TimeZone Extends Object
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.

Inheritance

Object
     goog.i18n.TimeZone

Constructor

goog.i18n.TimeZone()

Instance Methods

Public Protected Private
getDaylightAdjustment(date)
Return the adjustment amount of time zone offset. When daylight time is in effect, this number will be positive. Otherwise, it is zero.
Arguments:
date :
the time to check.
Returns:   offset amount.
code »
getGMTString(date)
Return the GMT representation of this time zone object.
Arguments:
date :
The date for which time to retrieve GMT string.
Returns:   GMT representation string.
code »
getLongName(date)
To get long time zone name for given date.
Arguments:
date :
The Date object for which time to retrieve long time zone name.
Returns:   long time zone name.
code »
getOffset(date)
To get time zone offset (in minutes) relative to UTC for given date. To be consistent with JDK/Javascript API, west of Greenwich will be positive.
Arguments:
date :
The date for which time to retrieve time zone offset.
Returns:   time zone offset in minutes.
code »
getRFCTimeZoneString(date)
To get RFC representation of certain time zone name for given date.
Arguments:
date :
The Date object for which time to retrieve RFC time zone string.
Returns:   RFC time zone string.
code »
getShortName(date)
To get short time zone name for given date.
Arguments:
date :
The date for which time to retrieve short time zone.
Returns:   short time zone name.
code »
getTimeZoneId()
Return time zone id for this time zone.
Returns:   time zone id.
code »
isDaylightTime(date)
Check if the given time fall within daylight saving period.
Arguments:
date :
time for which to check.
Returns:   true if daylight time in effect.
code »

Static Methods

goog.i18n.TimeZone.composeGMTString_(offset)
Generate GMT string given a time zone offset.
Arguments:
offset :
time zone offset in minutes.
Returns:   GMT string for this offset.
code »
goog.i18n.TimeZone.composePosixTimeZoneID_(offset)
POSIX time zone ID as fallback.
Arguments:
offset :
time zone offset in minutes.
Returns:   posix time zone id for given offset.
code »
goog.i18n.TimeZone.composeUTCString_(offset)
Generate UTC string.
Arguments:
offset :
time zone offset in minutes.
Returns:   UTC string for given offset.
code »
goog.i18n.TimeZone.createSimpleTimeZone_(timeZoneOffsetInMinutes)
This factory method provides a decent fallback to create a time zone object just based on a given time zone offset.
Arguments:
timeZoneOffsetInMinutes :
time zone offset in minutes.
Returns:   A goog.i18n.TimeZone object generated by just using the time zone offset information.
code »
goog.i18n.TimeZone.createTimeZone(timeZoneData)
This factory method creates a time zone instance. It takes either a time zone information array or a simple timezone offset. The latter form does not offer the same set of functionalities as first form.
Arguments:
timeZoneData :
this parameter could take 2 types, if it is a number, a simple TimeZone object will be created. Otherwise, it should be an Object that holds all time zone related information.
Returns:   A goog.i18n.TimeZone object for the given time zone data.
code »

Static Properties

goog.i18n.TimeZone.MILLISECONDS_PER_HOUR_ :
Milliseconds per hour constant.
Code »

Package i18n

Package Reference