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.
| Instance Method Summary | |
getDaylightAdjustment(?goog.date.DateLike date) ⇒ numberReturn the DST adjustment to the time zone offset for a given time. While Daylight Saving Time is in effect, this number is positive. Otherwise, it is zero. | |
getGMTString(?goog.date.DateLike date) ⇒ stringReturn the GMT representation of this time zone object. | |
getLongName(?goog.date.DateLike date) ⇒ stringGet the long time zone name for a given date/time. | |
getOffset(?goog.date.DateLike date) ⇒ numberGet the time zone offset in minutes WEST of UTC for a given date/time. | |
getRFCTimeZoneString(?goog.date.DateLike date) ⇒ stringGet the RFC representation of the time zone for a given date/time. | |
getShortName(?goog.date.DateLike date) ⇒ stringGet the short time zone name for given date/time. | |
getTimeZoneData() ⇒ ?ObjectConvert the contents of time zone object to a timeZoneData object, suitable for passing to goog.i18n.TimeZone.createTimeZone. | |
getTimeZoneId() ⇒ stringReturn the time zone ID for this time zone. | |
isDaylightTime(?goog.date.DateLike date) ⇒ booleanCheck if Daylight Saving Time is in effect at a given time in this time zone. | |
| Static Method Summary | |
composeGMTString_(number offset) ⇒ stringGenerate a GMT-relative string for a constant time zone offset. | |
composePosixTimeZoneID_(number offset) ⇒ stringGenerate a POSIX time zone ID for a constant time zone offset. | |
composeUTCString_(number offset) ⇒ stringGenerate a UTC-relative string for a constant time zone offset. | |
createSimpleTimeZone_(number timeZoneOffsetInMinutes) ⇒ ?goog.i18n.TimeZoneThis factory method creates a time zone object with a constant offset. | |
createTimeZone((Object|null|number) timeZoneData) ⇒ ?goog.i18n.TimeZoneThis 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. | |