Changes
Jump to navigation
Jump to search
no edit summary
{{Documentation subpage}}
{{high-use|25000}}
<!-------------------------------------------------------------------
Place categories where indicated at the bottom of this page,
please; interwikis to Wikidata (see [[Wikipedia:Wikidata]]).
-------------------------------------------------------------------->
=== 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 ===
* <code><nowiki>{{Get year}}</nowiki></code> {{Get year}}
* <code><nowiki>{{Get year|}}</nowiki></code> {{Get year|}}
* <code><nowiki>{{Get year|1946}}</nowiki></code> {{Get year|1946}}
* <code><nowiki>{{Get year|July 3, 1965}}</nowiki></code> {{Get year|July 3, 1965}}
* <code><nowiki>{{Get year|16 November 1971}}</nowiki></code> {{Get year|16 November 1971}}
* <code><nowiki>{{Get year|1975-12-19}}</nowiki></code> {{Get year|1975-12-19}}
* <code><nowiki>{{Get year|3-7-2005}}</nowiki></code> {{Get year|3-7-2005}}
* <code><nowiki>{{Get year|3/27/2015}}</nowiki></code> {{Get year|3/27/2015}}
* <code><nowiki>{{Get year|1997 January 8}}</nowiki></code> <strong class="error">Error: Invalid time.</strong>
* <code><nowiki>{{Get year|0711}}</nowiki></code> {{Get year|0711}}
<includeonly>{{sandbox other||
<!-- Categories below here, interwikis to Wikidata. -->
[[Category:Date mathematics templates]]
}}</includeonly>
{{high-use|25000}}
<!-------------------------------------------------------------------
Place categories where indicated at the bottom of this page,
please; interwikis to Wikidata (see [[Wikipedia:Wikidata]]).
-------------------------------------------------------------------->
=== 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 ===
* <code><nowiki>{{Get year}}</nowiki></code> {{Get year}}
* <code><nowiki>{{Get year|}}</nowiki></code> {{Get year|}}
* <code><nowiki>{{Get year|1946}}</nowiki></code> {{Get year|1946}}
* <code><nowiki>{{Get year|July 3, 1965}}</nowiki></code> {{Get year|July 3, 1965}}
* <code><nowiki>{{Get year|16 November 1971}}</nowiki></code> {{Get year|16 November 1971}}
* <code><nowiki>{{Get year|1975-12-19}}</nowiki></code> {{Get year|1975-12-19}}
* <code><nowiki>{{Get year|3-7-2005}}</nowiki></code> {{Get year|3-7-2005}}
* <code><nowiki>{{Get year|3/27/2015}}</nowiki></code> {{Get year|3/27/2015}}
* <code><nowiki>{{Get year|1997 January 8}}</nowiki></code> <strong class="error">Error: Invalid time.</strong>
* <code><nowiki>{{Get year|0711}}</nowiki></code> {{Get year|0711}}
<includeonly>{{sandbox other||
<!-- Categories below here, interwikis to Wikidata. -->
[[Category:Date mathematics templates]]
}}</includeonly>