模板:Start date/doc

维基教科书,自由的教学读本


模板{{Start date}}{{End date}}会传回一个日期值,又或日期与时间的值。这个值传回的同时,还附带一个隐藏的ISO日期格式(以CSS实现),以供微格式使用。当用户端不能使用CSS时,这个隐藏的日期会自动降格。

何时不应使用这一模板?[编辑]

Do not use this template for:

  • dates that are uncertain e.g. "before 4 April 1933"; "around 18 November 1939".
  • dates outside the range given under "Limitation", below.
  • other, secondary dates
  • outside microformat-emitting templates - if in doubt, see the parent template's documentation
  • more than one date in any parent template

用法[编辑]

  • {{start date|year|month|day}}
  • {{start date|year|month|day|HH|MM|SS|TimeZone}} (MM and SS are optional; TimeZone may be a numerical value, or "Z" for UTC; see examples)
例子:
  • {{start date|1993}} → "1993年 (1993)"
  • {{start date|1993|02}} → "1993年2月 (1993-02)"
  • {{start date|1993|02|24}} → "1993年2月24日 (1993-02-24)"
  • {{start date|1993|02|24|08|30}} → "1993年2月24日 08:30 (1993-02-24T08:30)"
  • {{start date|1993|02|24|08|||+01:00}} → "1993年2月24日 (+01:00) (1993-02-24T08+01:00)"
  • {{start date|1993|02|24|08|||-07:00}} → "1993年2月24日 (-07:00) (1993-02-24T08-07:00)"
  • {{start date|1993|02|24|08|30|23}} → "1993年2月24日 08:30:23 (1993-02-24T08:30:23)"
  • {{start date|1993|02|24|08|30|23|Z}} → "1993年2月24日 08:30:23 (UTC) (1993-02-24T08:30:23Z)"
  • {{start date|1993|02|24|08|30|23|+01:00}} → "1993年2月24日 08:30:23 (+01:00) (1993-02-24T08:30:23+01:00)"
  • {{start date|1993|02|24|08|30|23|-07:00}} → "1993年2月24日 08:30:23 (-07:00) (1993-02-24T08:30:23-07:00)"

原来的英文版有 df 选项,当这选项被设定时,会强制日期以欧洲式(即 日/月/年 ,而非北美式的 月/日/年)显示。这个选项在中文版无效。例如:

  • {{Start date|1993|02|24|08|30|df=yes}} 仍然显示为 年/月/日: "1993年2月24日 08:30 (1993-02-24T08:30)"

注意:

如果year参数留空的话,即使后面有填入month、day参数也不会显示:

  • {{Start date| |02|24}} 返回 " ()"(空白)

如果有year、day参数无month参数,只显示年份,其它情况如此类推:

  • {{Start date|1993| |24}} 返回 "1993年 (1993)"

Parameters[编辑]

这是用于新版可视化编辑器及其他工具的模板数据文档。

Start date模板数据

Date that an event or entity started or was created

模板参数

参数描述类型状态
YYYY1

start year

数字可选
MM2

start month

数字可选
DD3

start day of month

数字可选
HH4

start hours

数字可选
MM5

start minutes

默认值
0
数字可选
SS6

start seconds

默认值
0
数字可选
TZ7

time zone offset, “+02:00”, “-06:00” or “Z” for UTC

单行文本可选
day firstdf

boolean parameter to put the date before the month name

默认值
false
单行文本可选

使用微格式[编辑]

中文维基暂无该微格式模板。

详情请看 微格式专题

参看[编辑]