Template:Date

From Terraria Wiki
Jump to navigation Jump to search
This template is i18n-ready, which means it is easy to localize for different languages. Please see I18n & l10n for templates to learn more.
See Template:Date/l10n for the localization of this template.
Template-info.svg Documentation The documentation below is transcluded from Template:Date/doc. (edit | history)

This template is used to display a date in a standardized format.

Usage

{{ date | <year> | <month> | <day> }}

or

{{ date | date = <date string> }}

ParameterDescriptionTypeStatus
Year1
Year; preferably with exactly four digits.
Example:
2011
Line
suggested
Month2
Month; 1 to 12, with or without leading zero.
Example:
05
Line
suggested
Day3
Day; 1 to 31, with or without leading zero.
Example:
16
Line
suggested
Datedate
Alternative to the three unnamed parameters, will override them if specified. See mw:Time for accepted values.
Example:
2011-05-16
Line
optional
Day toggleday
Whether to display the day part (as opposed to just year and month). Default is true if $date is used; otherwise depends on whether $3 is specified.
Auto value:
False (0)
Boolean
optional
Languagelang
Output language. Can almost always be omitted as it defaults to the result of {{lang}} (local wiki language).
Example:
en
Line
optional

This template prefers inline formatting of parameters.

Examples

Code Output
{{date|2011|05|16}} May 16, 2011
{{date|2011|05}} May 2011
{{date|2011|05|16|day=no}} May 2011
{{date|2011|05|day=yes}} May 1, 2011
{{date|date=2011 May}} May 1, 2011
{{date|date=may 16, 2011}} May 16, 2011
{{date|date=2011 May|day=no}} May 2011
{{date|2011|05|16|lang=zh}} 2011 年 05 月 16 日