Template:Date
跳到导航
跳到搜索
This template is used to display a date in a standardized format.
Usage
{{ date | <year> | <month> | <day> }}
or
{{ date | date = <date string> }}
参数 | 描述 | 类型 | 状态 | |
---|---|---|---|---|
Year | 1 | Year; preferably with exactly four digits.
| 单行文本 | 推荐 |
Month | 2 | Month; 1 to 12, with or without leading zero.
| 单行文本 | 推荐 |
Day | 3 | Day; 1 to 31, with or without leading zero.
| 单行文本 | 推荐 |
Date | date | Alternative to the three unnamed parameters, will override them if specified. See mw:Time for accepted values.
| 单行文本 | 可选 |
Day toggle | day | 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.
| 布尔值 | 可选 |
Language | lang | Output language. Can almost always be omitted as it defaults to the result of {{lang}} (local wiki language).
| 单行文本 | 可选 |
此模板首选参数行内格式。
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 日 |