Template:Get year
Jump to navigation
Jump to search
1900
This template is used on approximately 25,000 pages, so changes to it will be widely noticed. Please test any changes in the template's /sandbox or /testcases subpages, or in your own user subpage. Please consider discussing changes on the talk page before implementing them. |
Purpose
Given a plain text date, returns the year. Accepts ISO 8601, a variety of date formats as well as a year-only date specification.
Limitations
Does [not?] understand BC / AD and may not deliver accurate results for single-digit dates.
Examples
{{Get year}}
1900{{Get year|}}
2024{{Get year|1946}}
1946{{Get year|July 3, 1965}}
1965{{Get year|16 November 1971}}
1971{{Get year|1975-12-19}}
1975{{Get year|3-7-2005}}
2005{{Get year|3/27/2015}}
2015{{Get year|1997 January 8}}
Error: Invalid time.{{Get year|0711}}
0711
The above documentation is transcluded from Template:Get year/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |