Template:ISOyear/doc
![]() |
This is a documentation subpage for (see that page for the template itself). It contains usage information, categories and other content that is not part of the original template page. |
Extracts year from calendar dates in ISO 8601 extended format (YYYY-MM-DD, e.g. "2025-08-05"). 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.
Usage
{{ISOyear|1=}}
Parameters
Parameter name | Description | Default value | required or optional?
|
---|---|---|---|
parameter #1 (1) | date in ISO 8601 format. Supported formats: YYYY-MM-DD, YYYY-MM, 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}}
Testing
More tests can be found at Template:ISOyear/testcases.
YYYY-MM-DD tests:
- {{ISOyear{{{3}}}{{{4}}}{{{5}}}{{{6}}}{{{7}}}{{{8}}}{{{9}}}{{{10}}}{{{11}}}...}} gives "Lua error in Module:Date at line 46: attempt to call local 'date' (a table value)."
- {{ISOyear{{{3}}}{{{4}}}{{{5}}}{{{6}}}{{{7}}}{{{8}}}{{{9}}}{{{10}}}{{{11}}}...}} gives "Lua error in Module:Date at line 46: attempt to call local 'date' (a table value)."
- {{ISOyear{{{3}}}{{{4}}}{{{5}}}{{{6}}}{{{7}}}{{{8}}}{{{9}}}{{{10}}}{{{11}}}...}} gives "Lua error in Module:Date at line 46: attempt to call local 'date' (a table value)."
- {{ISOyear{{{3}}}{{{4}}}{{{5}}}{{{6}}}{{{7}}}{{{8}}}{{{9}}}{{{10}}}{{{11}}}...}} gives "Lua error in Module:Date at line 46: attempt to call local 'date' (a table value)."
- {{ISOyear{{{3}}}{{{4}}}{{{5}}}{{{6}}}{{{7}}}{{{8}}}{{{9}}}{{{10}}}{{{11}}}...}} gives "Lua error in Module:Date at line 46: attempt to call local 'date' (a table value)."
- {{ISOyear{{{3}}}{{{4}}}{{{5}}}{{{6}}}{{{7}}}{{{8}}}{{{9}}}{{{10}}}{{{11}}}...}} gives "Lua error in Module:Date at line 46: attempt to call local 'date' (a table value)."
- {{ISOyear{{{3}}}{{{4}}}{{{5}}}{{{6}}}{{{7}}}{{{8}}}{{{9}}}{{{10}}}{{{11}}}...}} gives "Lua error in Module:Date at line 46: attempt to call local 'date' (a table value)."
- {{ISOyear{{{3}}}{{{4}}}{{{5}}}{{{6}}}{{{7}}}{{{8}}}{{{9}}}{{{10}}}{{{11}}}...}} gives "Lua error in Module:Date at line 46: attempt to call local 'date' (a table value)."
- {{ISOyear{{{3}}}{{{4}}}{{{5}}}{{{6}}}{{{7}}}{{{8}}}{{{9}}}{{{10}}}{{{11}}}...}} gives "Lua error in Module:Date at line 46: attempt to call local 'date' (a table value)."
- {{ISOyear{{{3}}}{{{4}}}{{{5}}}{{{6}}}{{{7}}}{{{8}}}{{{9}}}{{{10}}}{{{11}}}...}} gives "Lua error in Module:Date at line 46: attempt to call local 'date' (a table value)."
- {{ISOyear{{{3}}}{{{4}}}{{{5}}}{{{6}}}{{{7}}}{{{8}}}{{{9}}}{{{10}}}{{{11}}}...}} gives "Lua error in Module:Date at line 46: attempt to call local 'date' (a table value)."
- {{ISOyear{{{3}}}{{{4}}}{{{5}}}{{{6}}}{{{7}}}{{{8}}}{{{9}}}{{{10}}}{{{11}}}...}} gives "Lua error in Module:Date at line 46: attempt to call local 'date' (a table value)."
- {{ISOyear{{{3}}}{{{4}}}{{{5}}}{{{6}}}{{{7}}}{{{8}}}{{{9}}}{{{10}}}{{{11}}}...}} gives "Lua error in Module:Date at line 46: attempt to call local 'date' (a table value)."
- {{ISOyear{{{3}}}{{{4}}}{{{5}}}{{{6}}}{{{7}}}{{{8}}}{{{9}}}{{{10}}}{{{11}}}...}} gives "Lua error in Module:Date at line 46: attempt to call local 'date' (a table value)."
- {{ISOyear{{{3}}}{{{4}}}{{{5}}}{{{6}}}{{{7}}}{{{8}}}{{{9}}}{{{10}}}{{{11}}}...}} gives "Lua error in Module:Date at line 46: attempt to call local 'date' (a table value)."
YYYY-MM tests:
- {{ISOyear{{{3}}}{{{4}}}{{{5}}}{{{6}}}{{{7}}}{{{8}}}{{{9}}}{{{10}}}{{{11}}}...}} gives "Lua error in Module:Date at line 46: attempt to call local 'date' (a table value)."
- {{ISOyear{{{3}}}{{{4}}}{{{5}}}{{{6}}}{{{7}}}{{{8}}}{{{9}}}{{{10}}}{{{11}}}...}} gives "Lua error in Module:Date at line 46: attempt to call local 'date' (a table value)."
- {{ISOyear{{{3}}}{{{4}}}{{{5}}}{{{6}}}{{{7}}}{{{8}}}{{{9}}}{{{10}}}{{{11}}}...}} gives "Lua error in Module:Date at line 46: attempt to call local 'date' (a table value)."
- {{ISOyear{{{3}}}{{{4}}}{{{5}}}{{{6}}}{{{7}}}{{{8}}}{{{9}}}{{{10}}}{{{11}}}...}} gives "Lua error in Module:Date at line 46: attempt to call local 'date' (a table value)."
- {{ISOyear{{{3}}}{{{4}}}{{{5}}}{{{6}}}{{{7}}}{{{8}}}{{{9}}}{{{10}}}{{{11}}}...}} gives "Lua error in Module:Date at line 46: attempt to call local 'date' (a table value)."
- {{ISOyear{{{3}}}{{{4}}}{{{5}}}{{{6}}}{{{7}}}{{{8}}}{{{9}}}{{{10}}}{{{11}}}...}} gives "Lua error in Module:Date at line 46: attempt to call local 'date' (a table value)."
- {{ISOyear{{{3}}}{{{4}}}{{{5}}}{{{6}}}{{{7}}}{{{8}}}{{{9}}}{{{10}}}{{{11}}}...}} gives "Lua error in Module:Date at line 46: attempt to call local 'date' (a table value)."
- {{ISOyear{{{3}}}{{{4}}}{{{5}}}{{{6}}}{{{7}}}{{{8}}}{{{9}}}{{{10}}}{{{11}}}...}} gives "Lua error in Module:Date at line 46: attempt to call local 'date' (a table value)."
- {{ISOyear{{{3}}}{{{4}}}{{{5}}}{{{6}}}{{{7}}}{{{8}}}{{{9}}}{{{10}}}{{{11}}}...}} gives "Lua error in Module:Date at line 46: attempt to call local 'date' (a table value)."
- {{ISOyear{{{3}}}{{{4}}}{{{5}}}{{{6}}}{{{7}}}{{{8}}}{{{9}}}{{{10}}}{{{11}}}...}} gives "Lua error in Module:Date at line 46: attempt to call local 'date' (a table value)."
- {{ISOyear{{{3}}}{{{4}}}{{{5}}}{{{6}}}{{{7}}}{{{8}}}{{{9}}}{{{10}}}{{{11}}}...}} gives "Lua error in Module:Date at line 46: attempt to call local 'date' (a table value)."
- {{ISOyear{{{3}}}{{{4}}}{{{5}}}{{{6}}}{{{7}}}{{{8}}}{{{9}}}{{{10}}}{{{11}}}...}} gives "Lua error in Module:Date at line 46: attempt to call local 'date' (a table value)."
- {{ISOyear{{{3}}}{{{4}}}{{{5}}}{{{6}}}{{{7}}}{{{8}}}{{{9}}}{{{10}}}{{{11}}}...}} gives "Lua error in Module:Date at line 46: attempt to call local 'date' (a table value)."
YYYY tests:
- {{ISOyear{{{3}}}{{{4}}}{{{5}}}{{{6}}}{{{7}}}{{{8}}}{{{9}}}{{{10}}}{{{11}}}...}} gives "Lua error in Module:Date at line 46: attempt to call local 'date' (a table value)."
- {{ISOyear{{{3}}}{{{4}}}{{{5}}}{{{6}}}{{{7}}}{{{8}}}{{{9}}}{{{10}}}{{{11}}}...}} gives "Lua error in Module:Date at line 46: attempt to call local 'date' (a table value)."
- {{ISOyear{{{3}}}{{{4}}}{{{5}}}{{{6}}}{{{7}}}{{{8}}}{{{9}}}{{{10}}}{{{11}}}...}} gives "Lua error in Module:Date at line 46: attempt to call local 'date' (a table value)."
- {{ISOyear{{{3}}}{{{4}}}{{{5}}}{{{6}}}{{{7}}}{{{8}}}{{{9}}}{{{10}}}{{{11}}}...}} gives "Lua error in Module:Date at line 46: attempt to call local 'date' (a table value)."
- {{ISOyear{{{3}}}{{{4}}}{{{5}}}{{{6}}}{{{7}}}{{{8}}}{{{9}}}{{{10}}}{{{11}}}...}} gives "Lua error in Module:Date at line 46: attempt to call local 'date' (a table value)."
- {{ISOyear{{{3}}}{{{4}}}{{{5}}}{{{6}}}{{{7}}}{{{8}}}{{{9}}}{{{10}}}{{{11}}}...}} gives "Lua error in Module:Date at line 46: attempt to call local 'date' (a table value)."
- {{ISOyear{{{3}}}{{{4}}}{{{5}}}{{{6}}}{{{7}}}{{{8}}}{{{9}}}{{{10}}}{{{11}}}...}} gives "Lua error in Module:Date at line 46: attempt to call local 'date' (a table value)."
- {{ISOyear{{{3}}}{{{4}}}{{{5}}}{{{6}}}{{{7}}}{{{8}}}{{{9}}}{{{10}}}{{{11}}}...}} gives "Lua error in Module:Date at line 46: attempt to call local 'date' (a table value)."
- {{ISOyear{{{3}}}{{{4}}}{{{5}}}{{{6}}}{{{7}}}{{{8}}}{{{9}}}{{{10}}}{{{11}}}...}} gives "Lua error in Module:Date at line 46: attempt to call local 'date' (a table value)."
- {{ISOyear{{{3}}}{{{4}}}{{{5}}}{{{6}}}{{{7}}}{{{8}}}{{{9}}}{{{10}}}{{{11}}}...}} gives "Lua error in Module:Date at line 46: attempt to call local 'date' (a table value)."
0ther:
- {{ISOyear{{{3}}}{{{4}}}{{{5}}}{{{6}}}{{{7}}}{{{8}}}{{{9}}}{{{10}}}{{{11}}}...}} gives "Lua error in Module:Date at line 46: attempt to call local 'date' (a table value)."
- {{ISOyear{{{3}}}{{{4}}}{{{5}}}{{{6}}}{{{7}}}{{{8}}}{{{9}}}{{{10}}}{{{11}}}...}} gives "Lua error in Module:Date at line 46: attempt to call local 'date' (a table value)."