Template:ISOyear
From Wikimedia Commons, the free media repository
Note: This template is used on a lot of pages. In order not to put too much load on the servers, edits should be kept to a bare minimum. Please discuss proposed changes on the talk page first.

This documentation is transcluded from Template:ISOyear/doc.
Extracts year from calendar dates in ISO 8601 extended format (YYYYMMDD, e.g. "20160502"). This template is very similar to {{#time: Y}} parser function , but accepts a year as input, even in cases where #time would interpret that as a time. In the case of wrong input template does not return anything.
Contents
Usage
{{ISOyear 1= }}
Template parameters
Parameter  Description  Default  Status  

1 
date in ISO 8601 format. Supported formats: YYYYMMDD, YYYYMM, YYYY. Other formats not officially supported but returning correct results include: single digit months and days and years without months or days can have any number of digits. Supported dates are any proleptic Gregorian calendar or Gregorian calendar dates between 1 January 0001 AD and 31 December 9999 AD.  empty  required 
Additional information
The template is intended to be used in the following namespaces: all namespaces
The template is intended to be used by the following user groups: all users
Relies on:
Module:Date
See also
{{ISOdate}}
Localization
This template is not intended to be localized.
Testing
More tests can be found at Template:ISOyear/testcases.
YYYYMMDD tests:
 {{ISOyear20090909}} gives "2009"
 {{ISOyear2009099}} gives "2009"
 {{ISOyear2009909}} gives "2009"
 {{ISOyear09090909}} gives "0909"
 {{ISOyear9090909}} gives "0909"
 {{ISOyear00990909}} gives "0099"
 {{ISOyear0990909}} gives "0099"
 {{ISOyear990909}} gives "0099"
 {{ISOyear+20090909}} gives "2009"
 {{ISOyear20090909}} gives "2009"
 {{ISOyear20091309}} gives "2009"
 {{ISOyear20090935}} gives "2009"
 {{ISOyear2009+09+09}} gives ""
 {{ISOyear2009/09/09}} gives ""
 {{ISOyear2009 09 09}} gives ""
YYYYMM tests:
 {{ISOyear200909}} gives "2009"
 {{ISOyear20099}} gives "2009"
 {{ISOyear200913}} gives "2009"
 {{ISOyear090909}} gives "0909"
 {{ISOyear90909}} gives "0909"
 {{ISOyear010009}} gives "0100"
 {{ISOyear009909}} gives "0099"
 {{ISOyear09909}} gives "0099"
 {{ISOyear9909}} gives "0099"
 {{ISOyear+200909}} gives "2009"
 {{ISOyear200909}} gives "2009"
 {{ISOyear2009/09}} gives ""
 {{ISOyear2009+09}} gives ""
YYYY tests:
 {{ISOyear2009}} gives "2009"
 {{ISOyear+2009}} gives "2009"
 {{ISOyear2009}} gives "2009"
 {{ISOyear0999}} gives "0999"
 {{ISOyear999}} gives "0999"
 {{ISOyear0099}} gives "0099"
 {{ISOyear099}} gives "0099"
 {{ISOyear99}} gives "0099"
 {{ISOyear9}} gives "0009"
 {{ISOyear0}} gives "0000"
0ther:
 {{ISOyear}} gives ""
 {{ISOyear24 December 1798}} gives ""
 {{ISOyearhello}} gives ""