Jump to content

Template:Start date

From RetroTechCollection
Revision as of 11:20, 27 April 2025 by Josh (talk | contribs) (Created page with "<includeonly>{{#switch:{{#expr:{{{3|0}}} > 0}} | 1 = <!-- Y – M – D precision --> <time datetime="{{padleft:{{{1}}}|4|0}}-{{padleft:{{{2}}}|2|0}}-{{padleft:{{{3}}}|2|0}}"> {{#time:d F Y|{{{1}}}-{{{2}}}-{{{3}}}}} </time> | #default = <!-- Y – M precision --> <time datetime="{{padleft:{{{1}}}|4|0}}-{{padleft:{{{2}}}|2|0}}"> {{#time:F Y|{{{1}}}-{{{2}}}-01}} </time> }}</includeonly><noinclude> == Template documentation == ;Purpose :Formats a pu...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


Template documentation

Purpose
Formats a publication/release “start date” so that:
  • **Humans** see a friendly date (12 December 1991 or October 1992)
  • **Machines/search engines** get an ISO-8601 timestamp via the HTML <time> element, improving metadata and accessibility.
Syntax
{{Start date|year|month|day}}
Parameters
# Name Mandatory Example Notes
1 year Yes 1991 4-digit year
2 month Yes 12 1–12 (leading zero optional)
3 day No 25 1–31.

Omit for year-month precision.

Examples
Wikitext Renders as
{{Start date|1991|12|12}}
{{Start date|1992|10}}
Technical notes
  • Uses to detect whether a day value was supplied.
  • zero-pads year/month/day to guarantee valid ISO format.
  • provides locale-aware formatting for the visible text.
  • No hard-coded CSS; the skin controls styling of the generated <time> tag.