Open main menu
Documentation icon Documentationviewedithistorypurge

This documentation is transcluded from Template:Date/doc.

This template is used to show a date in the language set in the preferences.

You can leave out parts of the data.

Usage

{{Date |year= |month= |day= |hour= |minute= |second= }}

Examples:

  • {{date|2009|1|9}}
  • {{date|2009|1|9|pl}}
  • {{date|2009|1|9|pl|case=}} - alternative way to get nominative case
  • {{date|2009|1|9|pl|case=gen}}
  • {{date|2009|1|9|pl|case=ins}}
  • {{date|2009|1|pl}}
  • {{date|2009|1|pl|form=gen}}
  • {{date|2009|1|pl|form=ins}}
  • {{date|year=888|lang=pl|case=ins|trim_year=yes}}
  • {{date|year=888|lang=pl|case=ins|trim_year=no}}
  • {{date|year=888|lang=pl|case=ins|trim_year=100-999}}
  • {{date|year=888|lang=pl|case=ins|trim_year=100-500}}

Microformat

The template returns the date, embed in a <time> element with attribute datetime that contain the date in the ISO 8601 format needed by the hCalendar (class="dtstart") microformat. See the microformats project.

Template parameters

ParameterDescriptionDefaultStatus
year
1
yearYear numberemptyoptional
month
2
monthMonth number or name (in English)emptyoptional
day
3
dayDay numberemptyoptional
hourhourHour number in 0-23 rangeemptyoptional
minuteminuteMinutes number in 0-59 rangeemptyoptional
secondsecondSeconds number in 0-59 rangeemptyoptional
lang
4
languageLanguage code (overrides user's preferences)language code of the user languageoptional
casecaseallows 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).emptyoptional
classclassallows 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.dtstartoptional
trim_year
trim year
trim yearShould 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-999optional

Additional information

The template is intended to be used in the following namespaces: the Template namespace

The template is intended to be used by the following user groups: all users

Relies on:
Module:Date

See also

{{ISOdate}} – Template used to parse the date in {{information}}
{{other date}} – Allows to specify a range of non-trivial date notations in a format that is localizable
{{odate}} – Allows to specify two dates, of original and of vectorization

Localize the date format at Module:I18n/date or request assistance at Template talk:Date or Module talk:I18n/date