Template:Start date and age/testcases

From Wikipedia, the free encyclopedia
Jump to: navigation, search

Default separator: semicolon[edit]

Parameters Current template Sandbox template
Full date (year, month, day)
|2013|02|01 February 1, 2013; 4 years ago (2013-02-01) February 1, 2013; 4 years ago (2013-02-01)
|2013|02|01|df=yes 1 February 2013; 4 years ago (2013-02-01) 1 February 2013; 4 years ago (2013-02-01)
|df=yes|2013|02|01 1 February 2013; 4 years ago (2013-02-01) 1 February 2013; 4 years ago (2013-02-01)
|2013|02|01|df=y 1 February 2013; 4 years ago (2013-02-01) 1 February 2013; 4 years ago (2013-02-01)
|2013|02|01|df=1 1 February 2013; 4 years ago (2013-02-01) 1 February 2013; 4 years ago (2013-02-01)
|2010|1|2|df=no January 2, 2010; 7 years ago (2010-01-02) January 2, 2010; 7 years ago (2010-01-02)
|2008|8|9|df=n August 9, 2008; 9 years ago (2008-08-09) August 9, 2008; 9 years ago (2008-08-09)
|2003|7|5|df=0 July 5, 2003; 14 years ago (2003-07-05) July 5, 2003; 14 years ago (2003-07-05)
100 days ago:
|2017|6|16
June 16, 2017; 3 months ago (2017-06-16) June 16, 2017; 3 months ago (2017-06-16)
Yesterday:
|2017|9|23
September 23, 2017; 1 day ago (2017-09-23) September 23, 2017; 1 day ago (2017-09-23)
Today:
|2017|9|24
September 24, 2017; 0 days ago (2017-09-24) September 24, 2017; 0 days ago (2017-09-24)
Tomorrow:
|2017|9|25
September 25, 2017; 0 days' time (2017-09-25) September 25, 2017; 0 days' time (2017-09-25)
In 4 days:
|2017|9|28
September 28, 2017; 3 days' time (2017-09-28) September 28, 2017; 3 days' time (2017-09-28)
In 1 month:
|2017|10|24
October 24, 2017; 29 days' time (2017-10-24) October 24, 2017; 29 days' time (2017-10-24)
In 76 days (2.5 months -1 day):
|2017|12|9
December 9, 2017; 2 months' time (2017-12-09) December 9, 2017; 2 months' time (2017-12-09)
In 77 days (2.5 months +1 day):
|2017|12|10
December 10, 2017; 2 months' time (2017-12-10) December 10, 2017; 2 months' time (2017-12-10)
In 910 days (2.5 yrs -a bit):
|2020|3|22
March 22, 2020; 2 years' time (2020-03-22) March 22, 2020; 2 years' time (2020-03-22)
In 920 days (2.5 yrs +a bit):
|2020|4|1
April 1, 2020; 2 years' time (2020-04-01) April 1, 2020; 2 years' time (2020-04-01)
Year and month
|2002|03 March 2002; 15 years ago (2002-03) March 2002; 15 years ago (2002-03)
|2002|11 November 2002; 14 years ago (2002-11) November 2002; 14 years ago (2002-11)
-11 months:
|2016|10
October 2016; 11 months ago (2016-10) October 2016; 11 months ago (2016-10)
+11 months:
|2018|8
August 2018; 11 months' time (2018-08) August 2018; 11 months' time (2018-08)
|2022|03 March 2022; 4 years' time (2022-03) March 2022; 4 years' time (2022-03)
|2022|11 November 2022; 5 years' time (2022-11) November 2022; 5 years' time (2022-11)
Year only
-10 yrs:
|2007
2007; 10 years ago (2007) 2007; 10 years ago (2007)
+10 yrs:
|2027
2027; 10 years' time (2027) 2027; 10 years' time (2027)
+11 yrs:
|2028
2028; 11 years' time (2028) 2028; 11 years' time (2028)

Optional separator: parentheses[edit]

Parameters Current template Sandbox template
Full date (year, month, day)
|2003|02|15|paren=yes February 15, 2003 (14 years ago) (2003-02-15) February 15, 2003 (14 years ago) (2003-02-15)
|2003|02|15|p=y February 15, 2003 (14 years ago) (2003-02-15) February 15, 2003 (14 years ago) (2003-02-15)
|2003|02|15|p=1 February 15, 2003 (14 years ago) (2003-02-15) February 15, 2003 (14 years ago) (2003-02-15)
|2003|02|15|df=y|p=y 15 February 2003 (14 years ago) (2003-02-15) 15 February 2003 (14 years ago) (2003-02-15)
Year and month
|2003|02|p=y February 2003 (14 years ago) (2003-02) February 2003 (14 years ago) (2003-02)
Year only
|2003|paren=yes 2003 (14 years ago) (2003) 2003 (14 years ago) (2003)

Line break with semicolon[edit]

Parameters Current template Sandbox template
Full date (year, month, day)
|2003|02|15|br=yes February 15, 2003;
14 years ago
 (2003-02-15)
February 15, 2003;
14 years ago
 (2003-02-15)
Year and month
|2003|02|br=y February 2003;
14 years ago
 (2003-02)
February 2003;
14 years ago
 (2003-02)
Year only
|2003|br=1 2003;
14 years ago
 (2003)
2003;
14 years ago
 (2003)

Line break with parentheses[edit]

Parameters Current template Sandbox template
Full date (year, month, day)
|2003|02|15|p=yes|br=yes February 15, 2003
(14 years ago)
 (2003-02-15)
February 15, 2003
(14 years ago)
 (2003-02-15)
Year and month
|2003|02|p=y|br=y February 2003
(14 years ago)
 (2003-02)
February 2003
(14 years ago)
 (2003-02)
Year only
|2003|p=1|br=1 2003
(14 years ago)
 (2003)
2003
(14 years ago)
 (2003)

Year and month only (no day)[edit]

Parameters Current template Sandbox template
|2015|11 November 2015; 1 year ago (2015-11) November 2015; 1 year ago (2015-11)
|2016|10 October 2016; 11 months ago (2016-10) October 2016; 11 months ago (2016-10)
|2016|11 November 2016; 10 months ago (2016-11) November 2016; 10 months ago (2016-11)
|2016|12 December 2016; 9 months ago (2016-12) December 2016; 9 months ago (2016-12)
|2017|1 January 2017; 8 months ago (2017-01) January 2017; 8 months ago (2017-01)
|2017|2 February 2017; 7 months ago (2017-02) February 2017; 7 months ago (2017-02)
|2017|3 March 2017; 6 months ago (2017-03) March 2017; 6 months ago (2017-03)
|2017|4 April 2017; 5 months ago (2017-04) April 2017; 5 months ago (2017-04)
|2017|5 May 2017; 4 months ago (2017-05) May 2017; 4 months ago (2017-05)
|2017|6 June 2017; 3 months ago (2017-06) June 2017; 3 months ago (2017-06)
|2017|7 July 2017; 2 months ago (2017-07) July 2017; 2 months ago (2017-07)
|2017|8 August 2017; 1 month ago (2017-08) August 2017; 1 month ago (2017-08)
|2017|9 September 2017; 0 months ago (2017-09) September 2017; 0 months ago (2017-09)
|2017|10 October 2017; 1 month's time (2017-10) October 2017; 1 month's time (2017-10)
|2017|11 November 2017; 2 months' time (2017-11) November 2017; 2 months' time (2017-11)
|2017|12 December 2017; 3 months' time (2017-12) December 2017; 3 months' time (2017-12)
|2018|1 January 2018; 4 months' time (2018-01) January 2018; 4 months' time (2018-01)
|2018|2 February 2018; 5 months' time (2018-02) February 2018; 5 months' time (2018-02)
|2018|3 March 2018; 6 months' time (2018-03) March 2018; 6 months' time (2018-03)

Year only (no month or day)[edit]

Parameters Current template Sandbox template
|2015 2015; 2 years ago (2015) 2015; 2 years ago (2015)
|2016 2016; 1 year ago (2016) 2016; 1 year ago (2016)
|2017 2017; 0 years ago (2017) 2017; 0 years ago (2017)
|2018 2018; 1 year's time (2018) 2018; 1 year's time (2018)
|2019 2019; 2 years' time (2019) 2019; 2 years' time (2019)

Month as text (name or abbreviation)[edit]

Parameters Current template Sandbox template
Year, month, day
|2001|August|19 August 19, 2001; 16 years ago (2001-08-19) August 19, 2001; 16 years ago (2001-08-19)
|2001|Aug|19|df=yes 19 August 2001; 16 years ago (2001-08-19) 19 August 2001; 16 years ago (2001-08-19)
Year and month (no day)
|2002|September September 2002; 15 years ago (2002-09) September 2002; 15 years ago (2002-09)
|2002|Sep September 2002; 15 years ago (2002-09) September 2002; 15 years ago (2002-09)
|2002|Sept September 2002; 15 years ago (2002-09) September 2002; 15 years ago (2002-09)

Undocumented usage[edit]

Parameters Current template Sandbox template
Year, month, day
|October 20, 2003 October 20, 2003; 13 years ago (October 20, 2003) October 20, 2003; 13 years ago (October 20, 2003)
|20 October 2003 20 October 2003; 13 years ago (20 October 2003) 20 October 2003; 13 years ago (20 October 2003)
|Oct. 20, 2003 Oct. 20, 2003; 13 years ago (Oct. 20, 2003) Oct. 20, 2003; 13 years ago (Oct. 20, 2003)
|20 Oct 2003 20 Oct 2003; 13 years ago (20 Oct 2003) 20 Oct 2003; 13 years ago (20 Oct 2003)
Year and month (no day)
|November 2004 November 2004; 12 years ago (November 2004) November 2004; 12 years ago (November 2004)
|Nov. 2004 Nov. 2004; 12 years ago (Nov. 2004) Nov. 2004; 12 years ago (Nov. 2004)

Empty/Missing parameters[edit]

Parameters Current template Sandbox template
No year
No parameters Error: first parameter is missing. () Error: first parameter is missing. ()
||12|20 Error: first parameter is missing. () Error: first parameter is missing. ()
||12| Error: first parameter is missing. () Error: first parameter is missing. ()
|||20 Error: first parameter is missing. () Error: first parameter is missing. ()
No month
|2001||20 2001; 16 years ago (2001) 2001; 16 years ago (2001)
|2001|| 2001; 16 years ago (2001) 2001; 16 years ago (2001)
No day
|2001|12| December 2001; 15 years ago (2001-12) December 2001; 15 years ago (2001-12)
|2001|| 2001; 16 years ago (2001) 2001; 16 years ago (2001)