Template:ISOdate
![]() | 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 part of the documentation is only available in some languages)
For a calendar date in ISO 8601 extended format in the form YYYY-MM-DD (e.g. "2023-03-28"), 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=}}
Parameters
Parameter name | Description (this part of the documentation is only available in some languages) | Default value | required or optional?
|
---|---|---|---|
parameter #1 (1) | Any proleptic Gregorian calendar or 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. | empty | required |
lang | language code of the user language ({{int:Lang}}) | optional | |
case | empty | optional | |
class | dtstart | optional | |
trim_year | 100-999 | optional |
Additional information[edit]
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:
Relies on:
Module:DateI18n
{{ISOdate|2023-03-28}}:
{{ISOdate|2023-03-28}}
⧼See also⧽
(this part of the documentation is only available in some languages)
{{date}}, {{other date}}, {{ISOyear}}
Localization
This template is not intended to be localized.
Test cases[edit]
|
|
The above documentation is transcluded from Template:ISOdate/doc. (edit | history) Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages. Please add categories to the /doc subpage. Subpages of this template. |