Misplaced Pages

Template:Start date/sandbox

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
< Template:Start date

This is the current revision of this page, as edited by Gonnym (talk | contribs) at 05:36, 1 July 2024 (sync with live). The present address (URL) is a permanent link to this version.

Revision as of 05:36, 1 July 2024 by Gonnym (talk | contribs) (sync with live)(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
This is the template sandbox page for Template:Start date (diff).
See also the companion subpage for test cases.
Template documentation[view] [edit] [history] [purge]
WarningThis template is used on approximately 500,000 pages, or roughly 1% 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.
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 Misplaced Pages:COinS.

This purpose of the {{start date}} template is to return the date (or date-time) that an event or entity started or was created, and to do so in a standard format. It also includes duplicate, machine-readable date (or date-time) in the ISO date format (which is hidden by CSS), for use inside other templates (or table rows) which 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".
  • 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 in any parent template
  • dates displayed using AM/PM format - this template only outputs 24-hour clocks

Syntax

  • {{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)
Examples
  • {{start date|1993}} → "1993 (1993)"
  • {{start date|1993|02}} → "February 1993 (1993-02)"
  • {{start date|1993|02|24}} → "February 24, 1993 (1993-02-24)"
  • {{start date|1993|02|24|08|30}} → "08:30, February 24, 1993 (1993-02-24T08:30)"
  • {{start date|1993|02|24|08|||+01:00}} → "February 24, 1993 (+01:00) (1993-02-24T08+01:00)"
  • {{start date|1993|02|24|08|||−07:00}} → "February 24, 1993 (−07:00) (1993-02-24T08−07:00)"
  • {{start date|1993|02|24|08|30|23}} → "08:30:23, February 24, 1993 (1993-02-24T08:30:23)"
  • {{start date|1993|02|24|08|30|23|Z}} → "08:30:23, February 24, 1993 (UTC) (1993-02-24T08:30:23Z)"
  • {{start date|1993|02|24|08|30|23|+01:00}} → "08:30:23, February 24, 1993 (+01:00) (1993-02-24T08:30:23+01:00)"
  • {{start date|1993|02|24|08|30|23|−07:00}} → "08:30:23, February 24, 1993 (−07:00) (1993-02-24T08:30:23−07:00)"

An optional parameter, df, can be set to "y" or "yes" (or indeed any value) to display the day before the month. 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|02|24|df=y}} → "24 February 1993 (1993-02-24)"
  • {{start date|1993|02|24|08|30|df=yes}} → "08:30, 24 February 1993 (1993-02-24T08:30)"

TemplateData

This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:Start date in articles based on its TemplateData.

TemplateData for Start date

Date that an event or entity started or was created

Template parameters

ParameterDescriptionTypeStatus
YYYY1

start year

Numberoptional
MM2

start month

Numberoptional
DD3

start day of month

Numberoptional
HH4

start hours

Numberoptional
MM5

start minutes

Default
0
Numberoptional
SS6

start seconds

Default
0
Numberoptional
TZ7

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

Lineoptional
day firstdf

boolean parameter to put the day before the month name

Default
false
Lineoptional
month firstmf

mf=yes: order mm-dd-yyyy (=the default order)

Default
yes
Stringdeprecated

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.

Example

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

See also

Birth, death and age templates
birth, death, age
Combined BDA template Description / use 
{{BirthDeathAge}}Combines functions of {{Birth date}}, {{birth-date}}, {{birth date and age}}, {{birth year and age}}, {{death date}}, {{death-date}}, {{death date and age}}, and {{death year and age}}.
Birth templates Description / use 
{{Birth date}}To display a birth date and related hidden metadata.
{{Birth-date}}
{{Birth date and age}}{{Birth date}} with suffix '(age N)'.
{{Birth date and age2}}{{Birth date and age}} plus age as of a specified date.
{{Birth-date and age}}As {{Birth date and age}}, but accepts dates in text form ('15 June 1950', 'June 15, 1950', 'June 1950', etc.).
{{Birth date and age in years and days}}{{Birth date and age}}, but with the age displayed in years and days rather than just years.
{{Birth year and age}}Year of birth and approximate age.
{{Birth based on age as of date}}To display approximate birth year and current age given a particular date (e.g. when a dated reference mentions the age of a person), only works for living people.
{{Birth based on age as of dates}}To display approximate birth year and current age given several particular dates (e.g. when a dated reference mentions the age of a person), only works for living people.
{{Birth based on age at death}}To display approximate birth year based on age at death, or on age at a specific date if death date isn't known.
Death templates Description / use 
{{Death date}}To display a death date and related hidden metadata.
{{Death-date}}
{{Death date and age}}{{Death date}} with suffix '(aged N)'; also called with {{event date and age}}.
{{Death-date and age}}As {{Death date and age}}, but accepts dates in text form ('15 June 1950', 'June 15, 1950', 'June 1950', etc.).
{{Death date and given age}}To display a death date and specified age.
{{Death year and age}}To display a year of, and approximate age at death.
age only
Conventional age templates Description / use 
{{Age in years, months, weeks and days}}Number of complete years, months, weeks and days between two dates.
{{Age in years, months and days}}Number of complete years, months and days between two dates.
{{Age in years and months}}Number of complete years and remaining months between two dates.
{{Age in years and days}}Number of complete years and remaining days between two dates.
{{Age in years and days nts}}{{Age in years and days}} with output formatted for use in number sortable tables.
{{Age in decimal years}}Number of years between two dates, rounded to the specified number of decimal places.
{{Age in years}}Number of years between two dates.
{{Age in years nts}}{{Age in years}} with output formatted for use in number sortable tables.
{{Age in months}}Number of months between two dates.
{{Age in weeks and days}}Number of weeks and days between two dates.
{{Age in weeks}}Number of weeks between two dates.
{{Age in days}}Age in days between two dates.
{{Age in days nts}}{{Age in days}} with output formatted for use in number sortable tables.
Reverse-determined age template Description / use 
{{Age}}Age based on number of complete years between two dates.
{{Age nts}}{{Age}} with output formatted for use in number sortable tables.
{{Age as of date}}Current age (in years) from a known age at a specified date.
{{Age for infant}}Current age for infant: months and days up to one year, years and months up to three years, and years beyond age 3.
start / end dates
Date-focused templates Description / use 
{{Start date}} / {{End date}}
{{Start-date}} / {{End-date}}
{{Start date and age}}
{{End date and age}}
miscellaneous
Template Description / use 
{{OldStyleDate}}Dates in Julian calendar.
{{OldStyleDateDY}}As {{OldStyleDate}} but used when Julian / Gregorian dates fall in different years.
{{OldStyleDateNY}}As {{OldStyleDate}} but without the year.
{{Unidentified for}}
{{Missing for}}
The above documentation is transcluded from Template:Start date/doc. (edit | history)
Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages.
Add categories to the /doc subpage. Subpages of this template. Category: