From Wikimedia Commons, the free media repository
Jump to: navigation, search

Dialog-warning-orange.svg 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.
  • Editing a template causes all pages that use the template to be re-rendered. If the template is used often, this can put a lot of load on the servers since it fills up the job queue.
  • Keep in mind that templates that are used on file description pages also show up on other wikis.
  • This page has been protected from editing to prevent vandalism. Only administrators can edit it. Get their attention by placing {{edit protected}} at the talk page.
Documentation icon Documentationviewedithistorypurge

This documentation is transcluded from Template:ISOdate/doc.

For a calendar date in ISO 8601 extended format in the form YYYY-MM-DD (e.g. "2016-05-03"), 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: }}).


{{ISOdate |1= }}

Template parameters

Parameter Description Default Status
date 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 a dash and a 2-digit month number; optionally this is followed by a dash and a 2-digit day number; optionally this is followed by the time. empty required
language language code (only needs to be provided if the language shall be fixed and independent from the user's preferences) language code of the user language ({{int:Lang}}) optional
case case allows to specify grammatical case for the month for languages that use them. Possible cases: Also Partitive (ptv), Inessive (ine), Elative (ela) and Illative (ill) cases are supported for Finnish language, in addition to Nominative and Genitive (gen). empty optional
class class allows to set the html class of the time node where the date is included. This is useful for microformats. The default value is, for legacy reasons, "dtstart" (used by hCalendar). See the microformats project. "class=" will remove all metadata. dtstart optional
trim year
trim year Should years smaller than 1000 be padded with zeros to the length of 4 digits or trimmed. Options:
  • 1, yes, true - for always trimming
  • 0, no, false - for always padding
  • xx-yy - where xx is a minimum trimmed year and yy is the maximum trimmed year, for conditional trimming which depends on the year range.
100-999 optional

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:



renders as:

See also

{{date}}, {{other date}}, {{ISOyear}}


This template is not intended to be localized.

Test cases

{{ISOdate|2010-08-18 18:15:30Z}}:
{{ISOdate|2010-08-18 08:15:30}}:
{{ISOdate|2010-08-18 08:15}}:
{{ISOdate|1970-08-18 08:15:30}}:
{{ISOdate|1969-08-18 08:15:30}}:
{{ISOdate|1800-08-18 08:15:30}}:
{{ISOdate|999-08-18 08:15:30}}: 08:15:30
{{ISOdate|119-08-18 08:15:30}}: 08:15:30
{{ISOdate|99-08-18 08:15:30}}: 08:15:30
{{ISOdate|19-08-18 08:15:30}}: 08:15:30
{{ISOdate|9-08-18 08:15:30}}: 08:15:30
{{ISOdate|1-08-18 08:15:30}}: 08:15:30