23 tháng 6, 2025
This template converts a date to one of the standard date formats used on the English Wikipedia. This template should only be used internally in other templates.
If you want sortable dates for a table, use {{Dts}} instead.
This template takes up to two parameters, both of which are optional:
{{date|
<date to be formatted>|<date formatting style>}}
{{date}}
produces 23 tháng 6, 2025. To avoid emitting the current date if none is input, use Template:fdate.none
applies no formatting whatsoeverdmy
gives d mmmm yyyy (e.g. 25/12/2011). This is the default format.mdy
gives mmmm d, yyyy (e.g. tháng 12 ngày 25, 2011)ymd
gives yyyy mmmm dd (e.g. 2011 tháng 12 ngày 25)iso
gives an ISO 8601 style yyyy-mm-dd (e.g. 2011-12-25)dmy
, or in "month d" format for formatting styles mdy
, ymd
and iso
.dmy
/ldmy
and mdy
/lmdy
are in accordance with the English language Wikipedia's . The use of iso
/liso
(ISO 8601) format within article prose is expressly discouraged by the Manual of Style; this format should only be used in tables or lists.Format | Input | Output |
---|---|---|
No format specified | {{date|2006-08-04}}
|
4 tháng 8, 2006 |
{{date|Aug 4, 2006}}
|
4 tháng 8, 2006 | |
{{date|4 Aug 2006}}
|
4 tháng 8, 2006 | |
{{date|4 Aug}}
|
4 tháng 8 | |
{{date|Aug 4}}
|
4 tháng 8 | |
{{date}}
|
23 tháng 6, 2025 | |
none format | {{date|2006-08-04|none}}
|
2006-08-04 |
{{date|Aug 4, 2006|none}}
|
Aug 4, 2006 | |
{{date|4 Aug 2006|none}}
|
4 Aug 2006 | |
{{date|4 Aug|none}}
|
4 Aug | |
{{date|Aug 4|none}}
|
Aug 4 | |
{{date||none}}
|
||
dmy format | {{date|2006-08-04|dmy}}
|
4/8/2006 |
{{date|Aug 4, 2006|dmy}}
|
4/8/2006 | |
{{date|4 Aug 2006|dmy}}
|
4/8/2006 | |
{{date|4 Aug|dmy}}
|
4 tháng 8 | |
{{date|Aug 4|dmy}}
|
4 tháng 8 | |
{{date||dmy}}
|
23 tháng 6 | |
mdy format | {{date|2006-08-04|mdy}}
|
tháng 8 ngày 4, 2006 |
{{date|Aug 4, 2006|mdy}}
|
tháng 8 ngày 4, 2006 | |
{{date|4 Aug 2006|mdy}}
|
tháng 8 ngày 4, 2006 | |
{{date|4 Aug|mdy}}
|
tháng 8 ngày 4 | |
{{date|Aug 4|mdy}}
|
tháng 8 ngày 4 | |
{{date||mdy}}
|
tháng 6 ngày 23 | |
ymd format | {{date|2006-08-04|ymd}}
|
2006 tháng 8 ngày 4 |
{{date|Aug 4, 2006|ymd}}
|
2006 tháng 8 ngày 4 | |
{{date|4 Aug 2006|ymd}}
|
2006 tháng 8 ngày 4 | |
{{date|4 Aug|ymd}}
|
tháng 8 ngày 4 | |
{{date|Aug 4|ymd}}
|
tháng 8 ngày 4 | |
{{date||ymd}}
|
tháng 6 ngày 23 | |
iso format | {{date|2006-08-04|iso}}
|
2006-08-04 |
{{date|Aug 4, 2006|iso}}
|
2006-08-04 | |
{{date|4 Aug 2006|iso}}
|
2006-08-04 | |
{{date|4 Aug|iso}}
|
tháng 8 ngày 4 | |
{{date|Aug 4|iso}}
|
tháng 8 ngày 4 | |
{{date||iso}}
|
tháng 6 ngày 23 |
A wide variety of other input formats are handled correctly by the template:
Input | Output |
---|---|
{{date|1st December 2008}} (ordinal 'st')
|
1 tháng 12, 2008 |
{{date|June 24 2006}} (missing comma)
|
24 tháng 6, 2006 |
{{date|24 june 2006}} (lowercase month name)
|
24 tháng 6, 2006 |
{{date|24 jun}} (abbreviated month name)
|
24 tháng 6 |
{{date|June 2006}}
|
tháng 6 năm 2006 |
Input strings that the template cannot format are returned unaltered. This includes strings containing characters such as square brackets, so any links will result in unformatted output.
Input | Output |
---|---|
{{date|23007-031-24}}
|
23007-031-24 |
{{date|[[1 tháng 12]] [[2008]]|ymd}}
|
1 tháng 12 2008 |
{{date|1 tháng 12 [[2008 trong phim|2008]]|mdy}}
|
1 tháng 12 2008 |
{{date|June 0, 2006}}
results in 31 tháng 5, 2006
.{{date|0 January 2006}}
becomes 31 tháng 12, 2005
.{{date|31 November 2008}}
results in 1 tháng 12, 2008
, since November has only 30 days.{{date|February 29, 2007}}
results in 1 tháng 3, 2007
, since 2007 was not a leap year.{{date|30 February 1712}}
results in 1 tháng 3, 1712
because – even though 30 February 1712 is a valid date in the Swedish calendar – February 1712 had only 29 days in the Gregorian calendar.The ISO 8601 standard requires mutual agreement between those using the format to use years earlier than 1583. Since no agreement has been obtained from our readers, that format should not be used for such years, nor for any date not in the Gregorian calendar.