模板:Start date/doc
文件:Edit-copy green.svg | This is a documentation subpage for 模板:Terminate sentence It may contain usage information, categories and other content that is not part of the original 模板 page. |
Warning | This template is used on approximately 506,000 pages, or roughly 6121% of all pages. To avoid major disruption and server load, any changes should be tested in the template's /sandbox or /testcases subpages, or in your own user subpage. The tested changes can be added to this page in a single edit. Consider discussing changes on the talk page before implementing them. |
文件:Commons-emblem-hand-orange.svg | This template should not be used in citation templates such as Citation Style 1 and Citation Style 2, because it includes markup that will pollute the COinS metadata they produce; see Wikipedia:COinS. |
文件:Lua-Logo.svg | This template uses Lua: |
{{Start date}} returns the date (or date and time) that an event or entity started or was created, in a standard format. It also includes a hidden (by CSS) duplicate, machine-readable date (or date and time) in the ISO date format, for use inside templates or table rows that emit microformats. It should be used only once in each such template and never used outside such templates. The hidden date degrades gracefully when CSS is not available.
When not to use this template[编辑源代码]
Do not use this template for:
- Dates that are uncertain, e.g., "before 4 April 1933", "around 18 November 1939", "19??".
- Date ranges, e.g. "c. 1690–1712"
- Dates outside the range given under "Limitation", below.
- Other, secondary dates
- Outside microformat-emitting templates or table rows; if in doubt, see the parent template's documentation
- More than one date
- Dates displayed using AM/PM format; this template only outputs 24-hour times
- Dates that are not calendar dates, e.g. "12th century" or "present" or "TBA"
In the above situations, omit the template entirely, using untemplated text.
Usage[编辑源代码]
{{Start date|YYYY}}
(year only){{Start date|YYYY|MM}}
(month and year){{Start date|YYYY|MM|DD}}
(year, month, and day){{Start date|YYYY|MM|DD|HH|MM|SS|Time zone}}
(date, time, and time zone)
Parameters[编辑源代码]
- The unnamed parameters, in order, represent the year (four digits; required parameter), month (one or two digits), day (one or two digits), hour in 24-hour time (one or two digits), minutes (one or two digits), seconds (one or two digits), and the time zone (see below).
- When specifying time of day, MM (minutes), SS (seconds), and the time zone are optional
- Time zone may be a numerical value, or
Z
for UTC (see examples) |df=yes
, an optional parameter, when set to|df=yes
or|df=y
displays the day before the month (e.g. "7 November 2004" instead of the default "November 7, 2004"). The order of parameters does not change (it remains YMD). This is primarily used in articles using DMY format for dates.
Examples[编辑源代码]
{{Start date|1993}}
→ 1993{{Start date|1993|02}}
→ February 1993{{Start date|1993|02|24}}
→ February 24, 1993{{Start date|1993|02|24|08|30}}
→ 08:30, February 24, 1993{{Start date|1993|02|24|08|7=+01:00}}
→ 08:00, February 24, 1993 (+01:00){{Start date|1993|02|24|08|7=−07:00}}
→ 08:00, February 24, 1993 (−07:00){{Start date|1993|02|24|08|30|23}}
→ 08:30:23, February 24, 1993{{Start date|1993|02|24|08|30|23|Z}}
→ 08:30:23, February 24, 1993 (UTC){{Start date|1993|02|24|08|30|23|+01:00}}
→ 08:30:23, February 24, 1993 (+01:00){{Start date|1993|02|24|08|30|23|−07:00}}
→ 08:30:23, February 24, 1993 (−07:00){{Start date|1993|02|24|df=y}}
→ 24 February 1993{{Start date|1993|02|24|08|30|df=yes}}
→ 08:30, 24 February 1993
Notes[编辑源代码]
Place any additional non-numeric text outside of the template:
- c.
{{Start date|1900}}
→ c. 1900 {{Start date|1993|02|24}}
, no later than 15:00 UTC → February 24, 1993 , no later than 15:00 UTC
TemplateData[编辑源代码]
TemplateData for Start date
Date that an event or entity started or was created
参数 | 描述 | 类型 | 状态 | |
---|---|---|---|---|
YYYY | 1 | Start year | 数字 | 必需 |
MM | 2 | Start month | 数字 | 推荐 |
DD | 3 | Start day of month | 数字 | 推荐 |
HH | 4 | Start hours | 数字 | 可选 |
MM | 5 | Start minutes
| 数字 | 可选 |
SS | 6 | Start seconds
| 数字 | 可选 |
TZ | 7 | Time zone offset, "+02:00", "-06:00" or "Z" for UTC | 单行文本 | 可选 |
Day first | df | Set to 'yes' to show the day before the month name
| 单行文本 | 可选 |
Use in microformats[编辑源代码]
This template also returns the date, hidden by CSS, in the ISO 8601 format needed by one or more of the following microformats:
usually, but not always, within infobox or similar templates, or tables.
Its use in hCard is for organizations, venues and similar; use {{Birth date}} or {{Birth date and age}} for people.
Similarly, {{End date}} returns the date as hCalendar's (class="dtend"
).
See the microformats project for further details.
Limitation[编辑源代码]
This template has no provision to deal with a date in a non-Gregorian calendar. Also, ISO 8601 requires mutual agreement among those exchanging information before using years outside the range 1583–9999 CE. Therefore, use of this template for non-Gregorian dates or dates outside that range constitutes a false claim of conformance to the ISO 8601 standard.
Any editor encountering such usage should change the date to plain text with no template; or if not confident in doing so, raise the matter on this template's talk page.
[编辑源代码]
{{Start date}}
Error: Year value is required (help)
Error: expandTemplate: template "Start date/sandbox" does not exist
{{Start date}}
Error: Year value is required (help)
Error: expandTemplate: template "Start date/sandbox" does not exist
Tracking categories[编辑源代码]
- Category:Pages using start date with unknown parameters (0)
- Category:Pages using Module:Date time with invalid values (2)
See also[编辑源代码]
- {{Start date text}}, an alternative to this template.
- {{Film date}}, a similar template for use with {{Infobox film}}.
- {{Start date and age}}
- {{Start and end dates}}
- {{End date}}
- {{End date text}}
- {{Trim date}}
- WikiProject Microformats