跳转到内容

Template:Birth-date

被永久保护的模板
维基百科,自由的百科全书

无法识别日期。

文档图示 模板文档[查看] [编辑] [历史] [清除缓存]

{{Start-date}}、{{Birth-date}}和{{End-date}}(也可使用{{Death-date}})是易于阅读的“纯文本”日期和时间模板,可为事件生成微格式日期。{{Start date}}/{{Birth date}}和{{End date}}/{{Death date}}模板也可生成微格式,但要求日期以标准、明确和国际化的ISO语法表达。而本模板支持“模糊”日期和时间。对于不知道确切时间、日期或月份的事件,用户可以省略这些细节。时区假定为事件所在地的时区。如果指定了时区信息,则必须设置可选的时区参数。

示例

{{Start-date}}、{{Birth-date}}、{{End-date}}及{{Death-date}}的示例(颜色仅用于强调)
下面的示例显示1941年12月7日 (1941-12-07),并生成隐藏的微格式日期:1941-12-07
{{start-date|December 7, 1941}} → 1941年12月7日 (1941-12-07)
{{birth-date|December 7, 1941}} → 1941年12月7日 (1941-12-07)
{{end-date|December 7, 1941}}   → 1941年12月7日 (1941-12-08)
{{death-date|December 7, 1941}}   → 1941年12月7日 (1941-12-08)
下面的示例显示1941年12月7日 (1941-12-07),并生成隐藏的微格式日期:1941-12-07
{{start-date|7 December 1941}} → 1941年12月7日 (1941-12-07)
{{birth-date|7 December 1941}} → 1941年12月7日 (1941-12-07)
{{end-date|7 December 1941}}   → 1941年12月7日 (1941-12-08)
{{death-date|7 December 1941}}   → 1941年12月7日 (1941-12-08)
下面的示例演示了如何显示日期、时区和时、分、秒(顺序通常并不重要)。显示5:43PM HST, December 7th, 1941 03:43 (1941-12-08UTC03:43Z),并生成隐藏的微格式日期(修正为UTC):1941-12-08T03:43Z
{{start-date|5:43PM HST, December 7th, 1941|tz=y}} → 5:43PM HST, December 7th, 1941 03:43 (1941-12-08UTC03:43Z)
{{birth-date|5:43PM HST, December 7th, 1941|tz=y}} → 5:43PM HST, December 7th, 1941 03:43 (1941-12-08UTC03:43Z)
{{end-date|5:43PM HST, December 7th, 1941|tz=y}}   → 5:43PM HST, December 7th, 1941 03:44 (1941-12-08UTC03:44Z)
{{death-date|5:43PM HST, December 7th, 1941|tz=y}}   → 5:43PM HST, December 7th, 1941 03:44 (1941-12-08UTC03:44Z)
下面的示例演示了通过提供当地位置来生成UTC值。显示1941年12月8日 03:20 (1941-12-08UTC03:20Z),并生成隐藏的微格式日期(修正为UTC):1941-12-08 T03:20Z
{{start-date|December 8, 1941 12:50PM Australia/Adelaide|tz=y}} → 1941年12月8日 03:20 (1941-12-08UTC03:20Z)
{{birth-date|December 8, 1941 12:50PM Australia/Adelaide|tz=y}} → 1941年12月8日 03:20 (1941-12-08UTC03:20Z)
{{end-date|December 8, 1941 12:50PM Australia/Adelaide|tz=y}}   → 1941年12月8日 03:21 (1941-12-08UTC03:21Z)
{{death-date|December 8, 1941 12:50PM Australia/Adelaide|tz=y}}   → 1941年12月8日 03:21 (1941-12-08UTC03:21Z)
下面的示例演示了儒略历日期的使用。显示1672年6月9日 (1672-06-09),并生成隐藏的微格式日期:1672-06-09
{{start-date|9 June 1672|{{OldStyleDate|9 June|1672|30 May}}}} → 1672年6月9日 (1672-06-09)
{{birth-date|9 June 1672|{{OldStyleDate|9 June|1672|30 May}}}} → 1672年6月9日 (1672-06-09)
{{end-date|9 June 1672|{{OldStyleDate|9 June|1672|30 May}}}}   → 1672年6月9日 (1672-06-10)
{{death-date|9 June 1672|{{OldStyleDate|9 June|1672|30 May}}}}   → 1672年6月9日 (1672-06-10)

微格式输出

Start date模板:

  • {{Start-date|31 December 2016}} → 2016年12月31日 (2016-12-31)
    2016年12月31日<span style="display:none">&#160;(<span class="dtstart ">2016-12-31</span>)</span>
  • {{Start date|2016|12|31|df=y}} → 2016年12月31日 (2016-12-31)
    2016年12月31日<span style="display:none">&#160;(<span class="bday dtstart published updated">2016-12-31</span>)</span>

Birth date模板:

  • {{Birth-date|31 December 2016}} → 2016年12月31日 (2016-12-31)
    2016年12月31日<span style="display:none">&#160;(<span class="dtstart bday">2016-12-31</span>)</span>
  • {{Birth date|2016|12|31|df=y}}(2016-12-31)2016年12月31日
    <span style="display:none">(<span class="bday">2016-12-31</span>)</span>2016年12月31日

End date模板:

  • {{End-date|31 December 2016}} → 2016年12月31日 (2017-01-01)
    2016年12月31日<span style="display:none">&#160;(<span class="dtend ">2017-01-01</span>)</span>
  • {{End date|2016|12|31|df=y}} → 2016年12月31日 (2016-12-31)
    2016年12月31日<span style="display:none">&#160;(<span class="dtend">2016-12-31</span>)</span>

Death date模板:

  • {{Death-date|31 December 2016}} → 2016年12月31日 (2017-01-01)
    2016年12月31日<span style="display:none">&#160;(<span class="dtend ">2017-01-01</span>)</span>
  • {{Death date|2016|12|31|df=y}} → 2016年12月31日2016-12-31
    2016年12月31日<span style="display:none">(<span class="dday deathdate">2016-12-31</span>)</span>

参数

匿名参数1
(必填)日期和时间,用于显示和输出微格式。如果没有年份,则假定为当前年份。如果缺少日,则假定为每月1日。如果缺少小时或分钟,则假定为零。如果缺少时区或地点,则假定为条目中讨论事件的当地时间。如果需要UTC时间,请参阅timezone参数的说明。编者可指定地名(见列表)或时区,如EDT、PST、HST等,这些时区将被适当调整为UTC(协调世界时),以便通过微格式编码传送到其他应用程序。需要公历日期。使用匿名参数2可以显示公历或农历日期。
ISO8601
(可选)填写后则将发送该ISO8601日期/时间值,而不是匿名参数1得出的值。
BCE
(公元前日期必填),如果日期为公元前,则设置为yes。
timezone
tz
(如果指定了时区信息,则必填)如果时间为UTC或者指定了位置、时区或时区偏移量,则设置为yes。

模板数据

以下是该模板的模板数据,适用于可视化编辑器等工具。

Birth-date模板数据

无描述。

模板参数[编辑模板数据]

参数描述类型状态
11

无描述

未知可选
22

无描述

未知可选
ISO8601ISO8601

无描述

未知可选
dtdt

无描述

未知可选
tztz

set to "yes" when timezone is present, or when timzone UTC is implicit

布尔可选
timezonetimezone

无描述

未知可选
BCEBCE

无描述

未知可选
BCBC

无描述

未知可选
displaydisplay

无描述

未知可选
class-extraclass-extra

无描述

未知可选
dfdf

无描述

未知可选

模糊的时间和日期

For the years 99 BC to 99AD especially, microformats may not be emitted properly unless expressed in the form YYYY-MM-DD. For users uninterested in microformats, it should be noted that this restriction has no known impacts other than microformat data which are currently invisible to users. The user of course may express the display form in the second parameter however they would like. Example: 1-2-3 is interpreted as February 3, 1 A.D, and emitted in that form via microformats when the user may have intended something else. Other 3 digit years may be misinterpreted as well, so best practice is to use leading zeros to make a 4 digit year for this date range. For example, February 274 will be interpreted as February 27, 2004. Instead, use "February 0274". Background: There is a good rationale for the behavior of the system function which actually does the hard work of this template. It is very unusual for people to mention such dates so long ago, so when we really mean this date, we must specify a 4 digit date. Outside of this period with ambiguous years, users may use free text dates without this restriction. Bot runs may make a conversion of non 4 digit years to 4 digits (with leading zeros) in order to refine Wikipedia's quality of microformat dates. These changes will not affect display, but for those curious, this is the rationale for such bot manipulations.

时区

可识别大多数时区缩写和大量地名。(请参见可识别的时区表)。

{{start-date|December 7, 1941 8:43AM Pacific/Honolulu }}1941年12月7日 19:13 (1941-12-07UTC19:13)
{{start-date|December 8, 1941 12:30PM Asia/Manila }}1941年12月8日 04:30 (1941-12-08UTC04:30)

参见