模板:Date/doc
跳至導覽
跳至搜尋
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 日 |