Home

# Class 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.

Instance Method Summary
| `getDaylightAdjustment(?goog.date.DateLike date) ⇒ number` Return 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) ⇒ string` Return the GMT representation of this time zone object.
| `getLongName(?goog.date.DateLike date) ⇒ string` Get the long time zone name for a given date/time.
| `getOffset(?goog.date.DateLike date) ⇒ number` Get the time zone offset in minutes WEST of UTC for a given date/time.
| `getRFCTimeZoneString(?goog.date.DateLike date) ⇒ string` Get the RFC representation of the time zone for a given date/time.
| `getShortName(?goog.date.DateLike date) ⇒ string` Get the short time zone name for given date/time.
| `getTimeZoneData() ⇒ ?Object` Convert the contents of time zone object to a timeZoneData object, suitable for passing to goog.i18n.TimeZone.createTimeZone.
| `getTimeZoneId() ⇒ string` Return the time zone ID for this time zone.
| `isDaylightTime(?goog.date.DateLike date) ⇒ boolean` Check if Daylight Saving Time is in effect at a given time in this time zone.

Static Method Summary
| `composeGMTString_(number offset) ⇒ string` Generate a GMT-relative string for a constant time zone offset.
| `composePosixTimeZoneID_(number offset) ⇒ string` Generate a POSIX time zone ID for a constant time zone offset.
| `composeUTCString_(number offset) ⇒ string` Generate a UTC-relative string for a constant time zone offset.
| `createSimpleTimeZone_(number timeZoneOffsetInMinutes) ⇒ ?goog.i18n.TimeZone` This factory method creates a time zone object with a constant offset.
| `createTimeZone((Object|null|number) 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.