Template:Time zone/doc
| This is a documentation subpage for Template:Time zone. It may contain usage information, categories and other content that is not part of the original template page. |
| This template should always be substituted – use {{subst:Time zone}}. |
{{Time zone}} can be used to quickly and consistently link to an article on a timezone, while automatically displaying the deviation from UTC.
It also contains sub-templates that contain the data for columns in the tz database.
Usage
[edit]{{subst:Time zone|timezone}}
Replace timezone with any standard time zone code.
If the time zone is omitted or unrecognised, the template defaults to displaying the provided argument.
Exceptions: Sometimes, two different time zones have the same abbreviation. As we cannot change them, a little trick must be used for lesser-used ones. Instead of using the template above, you must use the following template:
{{subst:Time zone|timezone continent}}
Replace timezone with any standard time zone code.
Replace continent with any of the following:
- Africa: AF
- Antarctica: AN
- Asia: AS
- Australia: AU
- Europe: EU
- North America: NA
- South America: SA
Examples:
- Irish Summer Time: {{subst:Time zone|IST EU}} gives IST (UTC+01:00)
- Indian Standard Time: {{subst:Time zone|IST}} gives IST (UTC+05:30)
Ireland being less inhabited than India, Indian Standard Time will be used more often than Irish Summer Time, and is therefore the default if no continent is specified.
See more examples below.
Examples
[edit]The list may not be exhaustive.
See also
[edit]- List of time zone abbreviations
- {{Infobox time zone}} – Displays an infobox on the right side of pages for the tz zones, if the page name matches a zone name. For an example see Greenwich Mean Time.
- {{time}} – Displays the current time in a parameter-specified time zone, using different time zone abbreviations.
tz database
[edit]Sub templates store data from the tz database and some related information. These examples are accurate as of version 2026c of the database.
| Code example | Produces | Description |
|---|---|---|
{{Time zone |
[https://data.iana.org/time-zones/releases/tzdata2026c.tar.gz 2026c] → 2026c |
Produces the version number of the tz database. Update this template when updating those below with data from a new release. Add a parameter (value doesn't matter) to include a link to the IANA FTP site. |
{{Time zone |
CN | Maps TZ to country code from zone.tab |
{{Time zone |
[[ISO 3166-1:CN|CN]] → CN |
Maps TZ to linked country code from zone.tab |
{{Time zone |
+4348+08735 | Maps TZ to coordinates in original format from zone.tab |
{{Time zone |
Xinjiang Time | Maps TZ to comments from zone.tab |
{{Time zone |
asia | Maps TZ to linked continent file that defines the zone (or link) and DST rules. |
{{Time zone |
+01:00 | Maps TZ to normal (non-DST) UTC offset |
{{Time zone |
[[UTC+01:00|+01:00]] → +01:00 |
Maps TZ to linked normal (non-DST) UTC offset |
{{Time zone |
UTC+01:00 | Maps TZ to normal (non-DST) UTC offset with prefix |
{{Time zone |
+02:00 | Maps TZ to DST UTC offset |
{{Time zone |
[[UTC+02:00|+02:00]] → +02:00 |
Maps TZ to linked DST UTC offset |
{{Time zone |
| [[ISO 3166-1:AQ|AQ]] || || [[Antarctica/South_Pole]] ||
|
Maps TZ to 4 elements as a wikitable row – country code, coordinates, zone name, and comments |
{{Time zone |
! scope="col" | [[ISO 3166 2-character country code|<abbr title="Country code">c.c.</abbr>]]
! scope="col" | Coordinates
! scope="col" | [[List of tz database time zones|Timezone name]]
! scope="col" | Comments
! scope="col" colspan="2" | [[UTC offset]]
|
A 6-column table header for the templates below.
Optionally, the two UTC offset columns can be merged by |
{{Time zone |
| [[ISO 3166-1:AQ|AQ]]
|
| Antarctica/South_Pole
|
| [[UTC+12:00|+12:00]]
| [[UTC+13:00|+13:00]]
|
Similar to {{Time zone/zone.tab cols wikitable}}, but adds two more lines to the output, containing the linked normal (non-DST) and DST UTC offsets |
{{Time zone |
| AQ
|
| Antarctica/South_Pole
|
| +12:00
| +13:00
|
Same as {{Time zone/zone.tab cols unlinked}}, but with no links |
{{Time zone |
| [[ISO 3166-1:AQ|AQ]]
|
| <div style="text-indent: -1.6em; margin-left: 1.6em;">Antarctica<wbr />/South_Pole</div>
|
| data-sort-value="43200" | [[UTC+12:00|+12:00]]
| data-sort-value="46800" | [[UTC+13:00|+13:00]]
|
A version of {{Time zone/zone.tab cols linked}} designed for:
Note: neither {{Time zone/zone.tab cols wiki6}} nor {{Time zone/zone.tab cols linked}} can currently be used for the full table in List of tz database time zones because of performance limitations in processing such a long table. They can, however, be used for a small number of rows in individual area articles. |
References
[edit]