แม่แบบ:Time/doc

This template displays the current time in a parameter-specified time zone. The time is calculated based on the offset from UTC for the specified time zone taking into account whether daylight saving time is currently active in that time zone.
Note: Most Wikipedia pages display a cached version of the page to reduce server load, so the template will only display the current time as of when the page was last parsed.  You can refresh the displayed time by clicking the small|refresh link.
__TOC__

**Usage**
Typically, all that is needed is:
time| where  is one of the supported time zone abbreviations
:
::MST
To change the rendered format:

:df=y

:y

:dmy

:iso

**Supported time zones**
This is a list of the currently supported time zone abbreviations:
*ACST (ACDT)
*AEST (AEDT)
*AKST (AKT)
*AoEname=non-standard
*AST (AT) (ADT)
*AWST
*BST
*BT
*CET (CEST)
*ChST
*CST (CT) (CDT)
*EET (EEST)
*EST (ET) (EDT)
*GMT
*GMT-IEname="IST"
*GMT-UKname="GMT-UK"
*HST (HDT)
*IDLEname=non-standard
*IDLWname=non-standard
*IRKT
*IST
*JST
*KRAT
*MSK
*MST
*MMT
*NPT
*NST
*NZST (NZDT)
*OMST
*PETT
*PKT
*PMSTname="PMST"
*PST (PT) (PDT)
*SAMT
*SAST
*SRET
*SST
*USZ1
*UTC
*VLAT
*WET (WEST)
*WGTname="WGT"
*WIB
*WIT
*WITA
*YAKT
*YEKT

**UTC offset**
To display the time at a particular UTC offset, specify the UTC time offset as the time zone:

:UTC-07:00
'UTC', a sign character, two hour digits, a colon, and two minute digits are required.  Accepted sign characters are: '+', '-' (hyphen), '±', and '−' (minus).

**Military/nautical time zones**
To display the time at a particular military or nautical time zone, use the time zone's alpha designation:

:M
Some military and nautical time zone designators are extended with an asterisk (*), a dagger (†), or double dagger (‡).  When writing this template for designators that are extended with a dagger or double dagger, use '+' and '++' respectively:

:M++

:M+

**Daylight saving time**
Daylight saving time (DST) calculations are automatic for those time zones where it is observed.  There are locales that do not observe DST within time zones where it is generally observed.  To render the correct time for a non-observant locale, set no:

:dst=no – time in Arizona

:MST – but, time on the Navajo Nation in Arizona
The opposite case is not supported.  For places like Thule Air Base in Greenland, which observes US DST rules while WGT observes EU DST rules, a time zone properties table will be needed in Module:Time.  See §Adding a new time zone.

**Error messages**
can produce several error messages.  These are:
 – error calculating dst timestamps – indicates an internal error because one or more of the following time zone properties is malformed: UTC offset, DST begin or end definition. To resolve this error make sure that the time zone's properties are correct.
 – incomplete definition for ... – indicates an internal error because one or more of the following time zone properties is missing: DST begin or end definition, DST event time, time zone article.  To resolve this error supply the missing properties.
 – invalid use of ± - the symbol ± is being used when the minute and hour offsets aren't 00:00
 – (required) the abbreviation of a time zone's standard time; must be lower case; this is the value that will be used in the template's time zone parameter
 – (required) the abbreviation of a time zone's standard time as it will be rendered by the template
 – the abbreviation of a time zone's daylight saving or summer time as it will be rendered by the template
 – (required) the offset in hours and minutes from UTC±00:00; has the form:  where  may be + (optional) or - (required for time zones west of the 0 meridian)
 – one of three keywords dmy, mdy, or iso used to specify date format typically used in the time zone; can be overridden with df template parameter
 – a four word sentence in the form     where:
: – any of the words 'first', '1st', 'second', '2nd', ... 'fifth', '5th', or 'last'
: – any of the day names 'Sunday', 'Monday', 'Tuesday', etc.; capitalization is not important but otherwise must be spelled correctly; abbreviations not supported
: – either of the words 'in' or 'of'
: – any of the month names 'January', 'February', 'March', etc.; capitalization is not important but otherwise must be spelled correctly; abbreviations not supported
 – (required if dst_begins is specified) same as dst_begins
 – (required if dst_begins is specified) the time that daylight saving time begins; usually local time; when DST begins at a specified time UTC (European Summer Time for example) use:  dst_time = 'hh:mm UTC'; four digits and the colon are required
 – the time that daylight saving time ends if different from the time it begins; usually local daylight saving time ; when DST ends at a specified time UTC use:  dst_e_time = 'hh:mm UTC'; four digits and the colon are required
 – (required) the title of a Wikipedia article that is appropriate to the timezone; do not include wikimarkup
The table-of-tables is organized east (plus UTC offsets) then west (minus UTC offset), by offset hours, and then alphabetically by time zone positional parameter name.

**Adding a new alias**
You may also want to add an alias of a timezone:
**{tz = },
To add a new time zone to Module:Time/data, add the appropriate information inside the single quotes.
 – (required) the abbreviation of a time zone's alias. This must be lower case.
 – (required) the abbreviation of the time zone that's already in the code. This must be lower case
The table-of-tables is organized east (plus UTC offsets) then west (minus UTC offset), and by if it's a DST offset or if it's not.

**See also**

**References**

**TemplateData**
{
	"params": {
		"1": {
			"label": "time zone",
			"description": "The time zone for the time formatting",
			"example": "EST",
			"type": "string",
			"suggested": true
		},
		"2": {
			"aliases": 
				"df"
			,
			"label": "date format",
			"description": "The format to render the date and time",
			"example": "dmy12",
			"suggested": true
		},
		"dst": {
			"label": "Daylight savings time",
			"example": "yes",
			"type": "string"
		},
		"lang": {
			"label": "ISO 639 language code",
			"description": "displays time/date in language specified by ISO 639 language",
			"type": "string"
		},
		"dateonly": {
			"description": "If 'yes', suppresses display of the time and only shows the date",
			"example": "yes",
			"type": "string"
		},
		"timeonly": {
			"description": "If 'yes', suppresses display of the date and only shows the time",
			"example": "yes",
			"type": "string"
		},
		"hide-tz": {
			"label": "Hide time zone?",
			"description": "If 'yes', suppresses time zone abbreviation",
			"example": "yes",
			"type": "string"
		},
		"unlink-tz": {
			"label": "Don't link time zone?",
			"description": "If 'yes', renders the timezone without linking to its article.",
			"example": "yes",
			"type": "string"
		}
	}
}