Template:ISOdate
Sarna News
- HEXTECH Review - Wave 3 Brings More Urban Options To Your Battlefield
- Your BattleTech News Round-Up For March, 2024
- Crashing 'Mechs With Jennifer Brozek, Author Of The Rogue Academy Trilogy
- Getting The Word Out With Rem Alternis, Catalyst Community & Marketing Director
- Bad 'Mechs - Yeoman
- Read more →
This template uses Lua: |
Any Gregorian calendar date between 1 January 1 AD and 31 December 9999 AD. Dates BC are not yet supported. Also incomplete dates are allowed: just the year or the year and the month. A year has to be written in full, without leading zeros. Optionally it is followed by hyphen-minus (-) and a 2-digit month number; optionally this is followed by hyphen-minus and a 2-digit day number; optionally this is followed by the time.
For a calendar date in ISO 8601 extended format in the form YYYY-MM-DD (e.g. "2024-04-18"), with or without time, this template extracts the year, month, day and time, and calls {{date}} with the year, month and day found to display the date in localised format, with the time, if specified, appended. It provides the convenience of passing on a date (or even a date and a time) from one template to another as a single parameter, even though {{date}} eventually needs the date components separately.
This template overcomes some flaws of the automatic conversion by {{#time: }} for non-full dates (e.g. "77-09" for September 77 AD, which would throw an error with {{#time: }}).
Usage[edit]
{{ISOdate |1= }}
Examples[edit]
Current Date[edit]
{{CURRENTYEAR}}-{{CURRENTMONTH}}-{{CURRENTDAY}}
renders as:
2024-04-18
Certain Date[edit]
{{{ISOdate|2022-11-22}}
renders as:
22 November 2022
See Also[edit]
- {{date}},
- {{other date}},
- {{ISOyear}}
Test cases[edit]
|
|