Jump to content

Template:UTC offset/doc

From Wikipedia, the free encyclopedia

This template returns a UTC offset string suitable for use with the {{#time:}} parser function:

{{UTC offset|MST}} → -6 hours

Usage

[edit]

This template takes two parameters:

  • <timezone code> – (required) the first positional parameter specifies the timezone for which the offset is desired
  • |dst= – (optional) when set to no, suppresses daylight saving time adjustment

Valid <timezone code> values are the same as those supported by {{time}}.

Typical use of this template is with the {{#time:}} parser function:

{{#time:H:i}} → 18:17 – UTC time
{{UTC offset|MST}} → -6 hours – MST or MDT offset from UTC
{{#time:H:i | {{UTC offset|MST}} }} → 12:17 – MST or MDT time

Use |dst=no to get the UTC offset for areas that do not support daylight saving time but are located within timezones that do: Arizona (does not) is located within the Mountain Time Zone (does).

Supported time zones

[edit]

This is a list of the currently supported time zone abbreviations:

  1. ^ a b c Nonstandard time zone included for convenience.
  2. ^ a b c To differentiate between multiple time zones abbreviated as IST, the template uses IST for Indian Standard Time, GMT-IE for Irish Standard Time, and ILST for Israel Standard Time/Summer Time.
  3. ^ To differentiate between Bangladesh Standard Time (BST) and year-round GMT, the template uses GMT-UK for the United Kingdom.
  4. ^ To differentiate between Paraguay Time (PYT), the template uses KPT for Pyongyang Time.

Error messages

[edit]

This template can emit three error messages:

  • unknown timezone <unknown timezone> – this message emitted when <unknown timezone> is not a timezone known to Module:Time. To resolve this error, use a known timezone specifier.
  • missing required timezone – this template requires a timezone specifier. To resolve this error, provide a known timezone specifier.
  • error calculating dst timestamps – this template automatically applies daylight saving adjustment for those timezones that support it. This error message indicates that the underlying data in Module:Time/data for the timezone is malformed. To resolve this error, the underlying data must be corrected. This may be accomplished by anyone with administrator or template editor permission. Post a message at Template talk:Time.