Template:Format date
Usage[edit source]
This template ({{Format date}}) returns a date, or date-time, without the hidden version for use in microformats. This template is probably best used internally in other templates.
If you need the microformat support, use template {{Start date}} instead.
If you want sortable dates for a table, use {{Date table sorting}} instead.
Syntax[edit source]
{{Format date|year|month|day}}
{{Format date|year|month|day|HH|MM|SS|TimeZone}}
(MM and SS are optional; TimeZone may be a numerical value, or "Z" for UTC; see examples)
Examples:
{{Format date|1993}}
returns "1993"{{Format date|1993|02}}
returns "February 1993"{{Format date|1993|02|24}}
returns "February 24, 1993"{{Format date|1993|02|24|08|30}}
returns "08:30, February 24, 1993"{{Format date|1993|02|24|08|+01:00}}
returns "February 24, 1993 (+01:00)"{{Format date|1993|02|24|08|-07:00}}
returns "February 24, 1993 (-07:00)"{{Format date|1993|02|24|08|30|23}}
returns "08:30:23, February 24, 1993"
{{Format date|1993|02|24|08|30|23|Z}}
returns "08:30:23, February 24, 1993 (UTC)"{{Format date|1993|02|24|08|30|23|+01:00}}
returns "08:30:23, February 24, 1993 (+01:00)"{{Format date|1993|02|24|08|30|23|-07:00}}
returns "08:30:23, February 24, 1993 (-07:00)"
An optional parameter, df, can be set to "y" or "yes" (or indeed any value) to display the day before the month. This is primarily used in articles about events in parts of the world where the day precedes the month in a date.
Examples:
{{Format date|1993|02|24}}
returns "24 February 1993"{{Format date|1993|02|24|08|30}}
returns "08:30, 24 February 1993"
Note: The template will appear broken when the parameters are left blank (as seen hereinbefore).
See also[edit source]
- {{Date}} (an alternative to this template, using a different syntax)
- {{Start date}} (using the same syntax, but with the support for microformats)
- {{Start-date}} (an alternative to the template {{Start date}})
- {{Format time}} for formatting times only
External links[edit source]
- Template:Format date at Wikipedia, the free Terran-based encyclopedia that anyone can edit.
This template does not put a working clock on your page. The clock will not update the time on your screen every minute. Instead, it records the date and time that the page was most recently edited or purged. If you want a clock that constantly updates, then go to Special:Preferences#mw-prefsection-gadgets and enable the Appearance item, "Add a clock to the personal toolbar that displays the current time in UTC and provides a link to purge the current page". |
Multiple units of time[edit source]
Type | Adjustable | Current | Last | Next |
---|---|---|---|---|
Date and Time | {{time}} | {{Currentdate}} (MDY) {{Plain now}} (DMY) {{Now}} (DMY in a complete sentence) |
||
Date Only | {{Dateonly}} {{Datedow}} (Has the day of the week) |
{{Date}} (Chose format) {{DATE}} (prefixed by date=) {{TODAY}} (DMY) |
{{Yesterday}} {{Day-1}} |
{{Tomorrow}} {{Day+1}} |
Time only | {{Timeonly}} | {{CURRENTTIME}} (12 h format) {{CURRENTTIME24}} (24 h format) |
||
Banners | {{Right now}} (Blue with time and number of Starfleet Logistics articles) {{Right now (User message)}} (Orange with time and number of Starfleet Logistics articles |
|||
Timestamp | {{Timestamp}} (Format YYYYMMDDhhmmss) |
Single units of time[edit source]
Unit of time | Adjustable | Current | Last | Next |
---|---|---|---|---|
SECOND | {{CURRENTSECOND}} | |||
MINUTE | {{CURRENTMINUTE}} | |||
HOUR | {{Currenthour}} | {{Hour-1}} | {{Hour+1}} | |
WEEK | {{CURRENTWEEKOFYEAR}} {{CURRENTWEEKOFMONTH}} |
|||
Day of Week | {{Dow}} | {{CURRENTWEEKDAYNAME}} {{CURRENTWEEKDAYABBREV}} {{CURRENTWEEKDAY}} |
{{LASTWEEKDAYNAME}} {{LASTWEEKDAYABBREV}} |
{{NEXTWEEKDAYNAME}} {{NEXTWEEKDAYABBREV}} |
MONTH | {{MONTHNAME}} {{MONTHABBREV}} {{MONTHNUMBER}} {{MONTH}} (zero padded) |
{{Currentmonth}} {{CURRENTMONTHABBREV}} {{CURRENTMONTHNUMBER}} {{CURRENTMONTHDAYS}} |
{{LASTMONTH}} (Can make not zero-padded) {{LASTMONTHNAME}} {{LASTMONTHABBR}} |
{{NEXTMONTH}} (Can make not zero-padded) {{NEXTMONTHNAME}} {{NEXTMONTHABBR}} |
Day of Month | {{Currentday}} | |||
YEAR | {{CURRENTYEARCC}} {{CURRENTYEARYY}} {{CURRENTISOYEAR}} {{CURRENTYEAR}} |
{{LASTYEAR}} | {{NEXTYEAR}} | |
Day of Year | {{CURRENTDAYOFYEAR}} | |||
DECADE | {{DECADE}} | {{CURRENTDECADE}} | {{LASTDECADE}} | {{NEXTDECADE}} |
CENTURY | {{CENTURY}} | {{CURRENTCENTURY}} | {{LASTCENTURY}} | {{NEXTCENTURY}} |
MILLENNIUM | {{MILLENNIUM}} | {{Currentmillennium}} |
Date and time Templates made for substitution:[edit source]
Month:
{{Lmonth}} produces Oct
{{Nmonth}} produces Dec
{{LastMonth}} produces October 2024
{{NextMonth}} produces December 2024
Individual Templates[edit source]
- {{Calendar}}
- {{Calendar clock with Starfleet Logistics stats}}
- {{Clock}}
- {{Digital clock}}
- {{Digital clock and date}}
Categories of Templates[edit source]
- Category:Time, date and calendar templates
- Category:Date-computing templates
- Category:Date-computing templates based on current time
- Category:ISO date templates
- Category:Calendar templates
- Category:Clock templates
External links[edit source]
- Template:Format date at Wikipedia, the free Terran-based encyclopedia that anyone can edit.
The above documentation is transcluded from Template:Format date/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |