模板: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 日