Template:Date

来自Terraria Wiki
跳到导航 跳到搜索
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 文档 以下文档来自Template:Date/doc。(编辑 | 历史

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

Usage

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

or

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

参数描述类型状态
Year1
Year; preferably with exactly four digits.
示例:
2011
单行文本
推荐
Month2
Month; 1 to 12, with or without leading zero.
示例:
05
单行文本
推荐
Day3
Day; 1 to 31, with or without leading zero.
示例:
16
单行文本
推荐
Datedate
Alternative to the three unnamed parameters, will override them if specified. See mw:Time for accepted values.
示例:
2011-05-16
单行文本
可选
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.
自动值:
False (0)
布尔值
可选
Languagelang
Output language. Can almost always be omitted as it defaults to the result of {{lang}} (local wiki language).
示例:
en
单行文本
可选

此模板首选参数行内格式。

Examples

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