This template does not require a rating on Wikipedia's
content assessment scale. It is of interest to the following WikiProjects: | ||||||||
|
This template does not seem to take leap days into account. I tried measuring from Feb. 28 to Mar. 1 of the following year; 1995-1996 should be "1 year, 2 days" and 1994-1995 should be "1 year 1 day", but both are the later:
I think I've found a way to fix it. -- Arctic Gnome ( talk • contribs) 23:11, 17 July 2007 (UTC)
This a great template, kudos to Moondyne for making it. I think this will eventually be in many tables, so I've gone ahead and protected it. -- Arctic Gnome ( talk • contribs) 02:12, 18 July 2007 (UTC)
I think this is a great template, and it will come in very handy for many. However, I was playing around with the template, and I noticed that it "allows" the user to input invalid dates. In other words, the template allows for input of the following three types of invalid dates:
All of these invalid dates should not be "allowed" as input ... nonetheless, they yield numerical results (which I assume are incorrect calculations). Is there any way to fix this? Thanks. ( Joseph A. Spadaro 19:55, 7 August 2007 (UTC))
Greetings,
The template as currently written gives ages with commas. I was wondering, would it be possible to have a template that does not give commas? Modern usage has tended to not use commas in this instance because a person's age is simply one number. Hence, if someone is 17.45 years old, we are given one age. To say that someone is "17 years, 45 days old" seems a bit laborious when it comes to reading long lists, as happens with the article List of living supercentenarians.
Sincerely, Robert Young Ryoung122 06:50, 9 August 2007 (UTC)
Greetings,
This seems to be an issue of style. Newspapers and book publications (including Guinness World Records) do NOT use commas for age (or the use of 'and'). The main reason is to save printing space (lowering cost and increasing efficienty, important with books that have to cut some material to meet a page limit). However, it has an added benefit: efficiency for the reader. One can read the age 'faster' without the , because one's mind has been trained to slow down when it sees a comma (like a 'yellow light' on the information superhighway). Further, it seems the best example of why 'not' to use them is the one you cited: 73 years, 4 months, and 16 days. It sounds like reading a novel. It is also old-fashioned and technically incorrect. Why? Because some months have 31 days; some have 30 days; February has 28 or 29 days. Comparing ages, then, requires the use of a 'day' counter, without 'months'...a 'day' is always the same for everyone. It makes sense to use commas for a novel but not for tables/graphs/mathematical formulas/etc. Note that using a comma could mess up an 'Excel' formula calculation.
The last reason is that the , implies movement, but most of the people on the longevity lists are dead and the age isn't going to change. Thus, it looks a bit visually distracting to have it there. It's a minor issue but in the long run, efficiency and readability argue for 'no commas' when an age is given in a table format.
However, this need not be an either/or proposition: perhaps two versions could be made (one with a comma and one without). The comma is better for use with the 'written word'/dialogue. Just an idea.
Sincerely, Robert Young Ryoung122 06:58, 10 August 2007 (UTC)
I think that we should keep the commas as per Joseph. It seems grammatically correct to have a comma there, and since this will mostly be used in lists, I do not foresee a problem with the flow and pacing of the text being slowed. -- Arctic Gnome ( talk • contribs) 14:27, 10 August 2007 (UTC)
{{ editprotected}}
Someone needs to add the {{ Protected template}} to this page. It's confusing some editors who come here and realize they can't edit it. Thanks. Hersfold ( t/ a/ c) 20:12, 21 August 2007 (UTC)
Is it possible to change the parameterization or make a similar template for an infants age so that it reads (age 3 mos. and 14 days.) below age 1 and (age 1 yr. and 3 mos.) between 1 yr and 2 years and just (age 3) above 2 years.-- TonyTheTiger ( t/ c/ bio/ tcfkaWCDbwincowtchatlotpsoplrttaDCLaM) 14:07, 2 October 2007 (UTC)
Is there a template for calculating age in Years, months, and days?— Markles 00:02, 3 December 2007 (UTC)
There reached a point on List of living former United States Senators where the templates information does not appear. Is there a reason for this? When it starts this, it says "Expression error: Unexpected < operator". ( Star Garnet 19:30, 15 December 2007 (UTC))
For some very strange reason, this template is emitting a bunch of Expression error: Unrecognised punctuation character "[" messages, but only under Lynx, not under a graphical browser such as Firefox. WTF?! — Steve Summit ( talk) 22:39, 28 November 2008 (UTC)
is anyone aware of a template that calculates future and elapsed time (T+/T-) rendered: xx years, xx months, xx days. my first choice was {{ For year month day}}, however, it apparently cannot handle the future. -- emerson7 17:31, 13 December 2008 (UTC)
"at the age of &0000000000000113.000000113 years, &0000000000000041.00000041" - is this Google's fault, or is it somethign we can improve? -- NE2 04:33, 2 November 2009 (UTC)
I have added this template to my userpage to show my age. I am born in 1988, and I'm 22 years old. The template says I am 21...
So it's off by a year.......
Skibden (
talk)
20:27, 5 October 2010 (UTC)
{{edit protected}}
When the number is 0, plural is displayed: "0 years, 3 days", "30 years, 0 days". This is incorrect. Please put singular instead: "0 year, 3 days", "30 years, 0 day".
Thanks.
Nnemo ( talk) 22:57, 10 March 2011 (UTC)
{{
edit protected}}
Are displayed: "0 years, 3 days", "30 years, 0 days".
This is not nice and prevents from using this template in some places.
Please put instead: "3 days", "30 years".
Thanks.
Nnemo ( talk) 23:08, 10 March 2011 (UTC)
align=right
. Using {{age in days}} is problematic for two reasons. Firstly, as these templates are currently set up, using this template and either {{age in days}} or {{
age in days nts}} will not give the correct sorting. This can be fixed, of course (we could have them both sort by seconds (as {{
val}} does)). However, the second problem is not as easy to deal with; often the editor will not know whether there will be zero full years or not. Suppose a minister is newly appointed, initially we'd use {{age in days}} but a year later we'd have to come back and change it to {{age in years and days}}. Not only would this be terribly inefficient but it's very likely that the editor won't come back to correct the mark up on the specific day in question. I propose that the number of years be omitted if it's zero. On the other hand, "0 days" is necessary for indicating precision as discussed above.
Jimp
15:25, 8 April 2015 (UTC){{edit protected}}
Is displayed: "30 years, 20 days".
In some places, the line gets cut just after the number: this is bad typography and so prevents from using this template. See Wikipedia:Line break handling, MOS:NBSP, Wikipedia:Manual of Style (dates and numbers)#Non-breaking spaces.
Please put instead: "30 years, 20 days".
Thanks.
Nnemo ( talk) 23:58, 10 March 2011 (UTC)
The first of these currently gives a bunch of ugly error messages due to a space (see source):
It was reported at Wikipedia:Village pump (technical)/Archive 136#An old problem in a table. PrimeHunter ( talk) 01:36, 11 April 2015 (UTC)
{{Age in years and days|2007|02|27|2008|03| 2}}
{{Age in years and days|2007|02|27|2008|03|2}}
{{Age in years and days|2007|02|27|2008|03|02}}
sandbox:
{{age in days|{{#ifexpr:03<02|{{#expr:2008-1}}|{{#ifexpr:03=02|{{#ifexpr: 2<27|{{#expr:2008-1}}|2008}}|2008}}}}|02|27|2008|03| 2}}
{{age in days|{{#ifexpr:03<02|{{#expr:2008-1}}|{{#ifexpr:03=02|{{#ifexpr: 2<27|{{#expr:2008-1}}|2008}}|2008}}}}|02|27|2008|03|2}}
Problem reported at Template talk:Age in days. Fix needs to be made in {{ Age in days}}, which is called by this template. – Wbm1058 ( talk) 23:44, 13 February 2016 (UTC)
Per my comment at Template talk:Age in days#Unexpected number error: spaces cause error message, I could make Module:Age work to replace this template as well, if wanted. Johnuniq ( talk) 01:29, 14 February 2016 (UTC)
When the result is about years and only one day, "years" is given in its singular form. That's what happens in World War II infobox: 6 years, 1 day. Cheers. Carlotm ( talk) 18:57, 8 May 2015 (UTC)
As noted 7 years ago but still the case - " "at the age of &0000000000000113.000000113 years, &0000000000000041.00000041" - is this Google's fault, or is it somethign we can improve?".
The issue is that this template always introduces a sort key, hidden by inline CSS, before the age; which is picked up by Google, and therefore pollutes the data displayed on Google's preview. I noticed this when searching for Emma Morano-Martinuzzi, the new oldest woman in the world, in the news at the moment - searching for her gives a Google summary of "Emma Martina Luigia Morano Martinuzzi (born 29 November 1899) is an Italian supercentenarian who is, at the age of 7009367502400000000♤116 years, 166 ...".
Any thoughts? The ideal would be a parameter or subtemplate to only include the NTS info when actually required; I suspect that, with this being used in so many places, what we might actually have to do is add a parameter or subtemplate to *exclude* the NTS info; unless someone could use a bot to go through and replace every instance which is in a sortable table with an alternative template. TSP ( talk) 14:40, 13 May 2016 (UTC)
{{age in years and days|1896|9|21|2011|4|14}}
→ 114 years, 205 days<span style="display:none" class="sortkey">7009361527840000000♠</span>114 years, 205 days
|sortable=on
is ugly. By the way, per my comment above on this page, it would be possible to replace this template with a module that is under development.
Johnuniq (
talk)
00:07, 14 May 2016 (UTC)
@ TheDJ: I changed Module:Age so {{ age in years and days/sandbox}} does not add a sort key, and created {{ age in years and days nts}} to include the sort key. The sandbox template could be used to replace the main template when we think it is ok to switch sorting off. I found {{ ayd}} which was a redirect to the current template, and changed it to redirect to {{age in years and days nts}} because {{ayd}} is used in tables of sortable durations. Johnuniq ( talk) 09:32, 22 April 2017 (UTC)
Module:Age implements a lot date/time functions, and it can emulate this template. To demonstrate, I changed {{ age in years and days/sandbox}} to use the module. Examining the testcases shows these differences.
Update: In the following, the results for {{age in years and days}} use fixed wikitext to show output from the old template. Johnuniq ( talk) 02:05, 6 May 2017 (UTC)
Difference #1
{{age in years and days|2004|2|29|2006|3|01}}
→ 2 years, 0 days{{age in years and days/sandbox|2004|2|29|2006|3|01}}
→ 2 years, 1 dayDifference #2
{{age in years and days|1 Mar 2004|28 Feb 2002}}
→ −2 years, 2 days{{age in years and days/sandbox|1 Mar 2004|28 Feb 2002}}
→ −2 years, 2 days{{age in years and days|2004|3|1|2002|2|28}}
→ -3 years, 364 days (not the wanted values, and uses a hyphen for negative){{age in years and days/sandbox|2004|3|1|2002|2|28}}
→ −2 years, 2 daysDifference #3 A space in an unexpected place causes an error in the existing template (see #Spaces cause error message above).
{{age in years and days|2007|2|1|2008|3| 1}}
→ (An error message was displayed by the old template){{age in years and days/sandbox|2007|2|1|2008|3| 1}}
→ 1 year, 29 daysThis is prompted by #Google problems above where it is proposed that the template be switched to sortable=off rather than the default, which is to include a hidden sort key before the result. Currently the module emulates the template including the fact that sortable=on is the default. It would be easy to change that default, or do anything else needed. Johnuniq ( talk) 11:29, 21 April 2017 (UTC)
2605:A000:1103:144:251E:BE4:FF27:D0B8 ( talk) 19:46, 18 November 2018 (UTC)== Using mm/dd/yyyy format for calculations ==
{{age in years and days|08/16/2016|07/24/2018}} gives Error: Need valid year, month, day results in an error, why? — Preceding unsigned comment added by 2605:a000:1103:c3:e8b6:2374:8937:4e50 ( talk • contribs) 14:17, 23 September 2018 (UTC)
{{age in years and days|2016-08-16|2018-07-24}}
→ 1 year, 342 days{{age in years and days|16 Aug 2016|24 July 2018}}
→ 1 year, 342 days{{date|08/16/2016}} gives 16 August 2016 and the format works on the date template — Preceding unsigned comment added by 2600:1:b1a6:97c5:b53a:2108:a250:3651 ( talk • contribs) 13:01, 24 September 2018 (UTC)
Well, {{date|08/16/2016}}
works perfectly, why do not use it then?, well 08/16/2016 can be parsed as 16 August 2016, because there is no 16th month.
@ Johnuniq Is it possible to display the duration between two dates with an offset (eg., minus 10 days, plus 15 days, etc.):
age in years and days|1 January 2017|1 January 2018 is expressed as 1 year, 0 days
age in years and days|date 1|date 2|parameter to add/subtract a duration is what I'm looking for.
If it's not possible, does another wiki template exist which can perform this? 156.196.150.85 ( talk) 22:44, 31 October 2018 (UTC)
{{age in years and days|1 January 2017|1 January 2018}}
→ 1 year, 0 days{{age in years and days|1 January 2017|{{extract|1 January 2018|add=-10d}}}}
→ 355 days{{age in years and days|1 January 2017|{{extract|1 January 2018|add=15d}}}}
→ 1 year, 15 days{{age in years and days|1 January 2017|{{extract|1 January 2018|add=3m 15d}}}}
→ 1 year, 105 daysHere is an example, when it's not a leap year and there's no February 29th, it will return as an error
{{age in years and days|1900|8|4|2018|2|29}}
- Error: Second date should be year, month, day will produce an error message why? (expected 117 years, 209 days), it should be corrected such like {{age in years and days|{{date|08/04/1900}}|{{date|02/29/2018}}}}
{{age in years and days|{{date|08/04/1900}}|{{date|02/29/2018}}}}
will be corrected as 117 years, 209 days
{{age in years and days|1900|8|4|2018|3|1}}
- age on 1 March 2018 will give 117 years, 209 days — Preceding
unsigned comment added by
98.31.29.4 (
talk)
{{date|02/29/2018}}
produces 1 March 2018 per
Template:Date#Known issues.
PrimeHunter (
talk)
00:26, 20 February 2019 (UTC)Also bugged with Feb 29 births, such as 118 years, 1 day (expected 118 years, 0 days) KaiHunter12 ( talk) 21:18, 24 June 2022 (UTC)
{{ayd|1904|2|29|2022|3|1}}
→ 118 years, 1 dayIt is 43,100 days from the start date to the end date, but not including the end date. Or 118 years, 1 day excluding the end date.Johnuniq ( talk) 23:52, 24 June 2022 (UTC)
Usually for
extreme old people the {{
age in years and days}}
is used, because it's easier, especially for the dead people and there first anniversary of their birth hasn't passed yet since they died
For an example
Tekla Juniewicz would've still been 116 if she were to still be alive as of 15 January 2023, however she would've been 118 years, 44 days though, when she died however on 19 August 2022 she was 116 years, 70 days, since the age of a dead person is permanent from when they died, there age does not increase after death
Age in years and days would seem more appropriate rather than just the age in years only especially for the people who died already and their first anniversary of their birth hasn't passed yet since they died which can be from 1 day to 1 year after they died.
Nabi Tajima would've still been 117 between 22 April 2018 and 3 August 2018 even if she was still alive, but the days would be from 261 to 364 rather than 260 days when she passed.
For people who died many many years ago such as George Washington when he died in December 1799 at the age of 67, if he was still alive today he would've been 292, the age in years and days wouldn't matter as much. 2603:6011:E00:4C41:0:0:0:1011 ( talk) 19:28, 15 January 2023 (UTC)
I was just reading an article on Maria Branyas. She was born on 4 March 1907. Today is March 1st. Using this template, it says that she is 115 years and 361 days.
On March 4th (3 days from now), she should be 116 years old, but 361 days + 3 is only 364.
Why is this off by a day? 2601:646:8400:C800:B7E9:CF81:2852:D240 ( talk) 14:44, 1 March 2023 (UTC)
This template does not require a rating on Wikipedia's
content assessment scale. It is of interest to the following WikiProjects: | ||||||||
|
This template does not seem to take leap days into account. I tried measuring from Feb. 28 to Mar. 1 of the following year; 1995-1996 should be "1 year, 2 days" and 1994-1995 should be "1 year 1 day", but both are the later:
I think I've found a way to fix it. -- Arctic Gnome ( talk • contribs) 23:11, 17 July 2007 (UTC)
This a great template, kudos to Moondyne for making it. I think this will eventually be in many tables, so I've gone ahead and protected it. -- Arctic Gnome ( talk • contribs) 02:12, 18 July 2007 (UTC)
I think this is a great template, and it will come in very handy for many. However, I was playing around with the template, and I noticed that it "allows" the user to input invalid dates. In other words, the template allows for input of the following three types of invalid dates:
All of these invalid dates should not be "allowed" as input ... nonetheless, they yield numerical results (which I assume are incorrect calculations). Is there any way to fix this? Thanks. ( Joseph A. Spadaro 19:55, 7 August 2007 (UTC))
Greetings,
The template as currently written gives ages with commas. I was wondering, would it be possible to have a template that does not give commas? Modern usage has tended to not use commas in this instance because a person's age is simply one number. Hence, if someone is 17.45 years old, we are given one age. To say that someone is "17 years, 45 days old" seems a bit laborious when it comes to reading long lists, as happens with the article List of living supercentenarians.
Sincerely, Robert Young Ryoung122 06:50, 9 August 2007 (UTC)
Greetings,
This seems to be an issue of style. Newspapers and book publications (including Guinness World Records) do NOT use commas for age (or the use of 'and'). The main reason is to save printing space (lowering cost and increasing efficienty, important with books that have to cut some material to meet a page limit). However, it has an added benefit: efficiency for the reader. One can read the age 'faster' without the , because one's mind has been trained to slow down when it sees a comma (like a 'yellow light' on the information superhighway). Further, it seems the best example of why 'not' to use them is the one you cited: 73 years, 4 months, and 16 days. It sounds like reading a novel. It is also old-fashioned and technically incorrect. Why? Because some months have 31 days; some have 30 days; February has 28 or 29 days. Comparing ages, then, requires the use of a 'day' counter, without 'months'...a 'day' is always the same for everyone. It makes sense to use commas for a novel but not for tables/graphs/mathematical formulas/etc. Note that using a comma could mess up an 'Excel' formula calculation.
The last reason is that the , implies movement, but most of the people on the longevity lists are dead and the age isn't going to change. Thus, it looks a bit visually distracting to have it there. It's a minor issue but in the long run, efficiency and readability argue for 'no commas' when an age is given in a table format.
However, this need not be an either/or proposition: perhaps two versions could be made (one with a comma and one without). The comma is better for use with the 'written word'/dialogue. Just an idea.
Sincerely, Robert Young Ryoung122 06:58, 10 August 2007 (UTC)
I think that we should keep the commas as per Joseph. It seems grammatically correct to have a comma there, and since this will mostly be used in lists, I do not foresee a problem with the flow and pacing of the text being slowed. -- Arctic Gnome ( talk • contribs) 14:27, 10 August 2007 (UTC)
{{ editprotected}}
Someone needs to add the {{ Protected template}} to this page. It's confusing some editors who come here and realize they can't edit it. Thanks. Hersfold ( t/ a/ c) 20:12, 21 August 2007 (UTC)
Is it possible to change the parameterization or make a similar template for an infants age so that it reads (age 3 mos. and 14 days.) below age 1 and (age 1 yr. and 3 mos.) between 1 yr and 2 years and just (age 3) above 2 years.-- TonyTheTiger ( t/ c/ bio/ tcfkaWCDbwincowtchatlotpsoplrttaDCLaM) 14:07, 2 October 2007 (UTC)
Is there a template for calculating age in Years, months, and days?— Markles 00:02, 3 December 2007 (UTC)
There reached a point on List of living former United States Senators where the templates information does not appear. Is there a reason for this? When it starts this, it says "Expression error: Unexpected < operator". ( Star Garnet 19:30, 15 December 2007 (UTC))
For some very strange reason, this template is emitting a bunch of Expression error: Unrecognised punctuation character "[" messages, but only under Lynx, not under a graphical browser such as Firefox. WTF?! — Steve Summit ( talk) 22:39, 28 November 2008 (UTC)
is anyone aware of a template that calculates future and elapsed time (T+/T-) rendered: xx years, xx months, xx days. my first choice was {{ For year month day}}, however, it apparently cannot handle the future. -- emerson7 17:31, 13 December 2008 (UTC)
"at the age of &0000000000000113.000000113 years, &0000000000000041.00000041" - is this Google's fault, or is it somethign we can improve? -- NE2 04:33, 2 November 2009 (UTC)
I have added this template to my userpage to show my age. I am born in 1988, and I'm 22 years old. The template says I am 21...
So it's off by a year.......
Skibden (
talk)
20:27, 5 October 2010 (UTC)
{{edit protected}}
When the number is 0, plural is displayed: "0 years, 3 days", "30 years, 0 days". This is incorrect. Please put singular instead: "0 year, 3 days", "30 years, 0 day".
Thanks.
Nnemo ( talk) 22:57, 10 March 2011 (UTC)
{{
edit protected}}
Are displayed: "0 years, 3 days", "30 years, 0 days".
This is not nice and prevents from using this template in some places.
Please put instead: "3 days", "30 years".
Thanks.
Nnemo ( talk) 23:08, 10 March 2011 (UTC)
align=right
. Using {{age in days}} is problematic for two reasons. Firstly, as these templates are currently set up, using this template and either {{age in days}} or {{
age in days nts}} will not give the correct sorting. This can be fixed, of course (we could have them both sort by seconds (as {{
val}} does)). However, the second problem is not as easy to deal with; often the editor will not know whether there will be zero full years or not. Suppose a minister is newly appointed, initially we'd use {{age in days}} but a year later we'd have to come back and change it to {{age in years and days}}. Not only would this be terribly inefficient but it's very likely that the editor won't come back to correct the mark up on the specific day in question. I propose that the number of years be omitted if it's zero. On the other hand, "0 days" is necessary for indicating precision as discussed above.
Jimp
15:25, 8 April 2015 (UTC){{edit protected}}
Is displayed: "30 years, 20 days".
In some places, the line gets cut just after the number: this is bad typography and so prevents from using this template. See Wikipedia:Line break handling, MOS:NBSP, Wikipedia:Manual of Style (dates and numbers)#Non-breaking spaces.
Please put instead: "30 years, 20 days".
Thanks.
Nnemo ( talk) 23:58, 10 March 2011 (UTC)
The first of these currently gives a bunch of ugly error messages due to a space (see source):
It was reported at Wikipedia:Village pump (technical)/Archive 136#An old problem in a table. PrimeHunter ( talk) 01:36, 11 April 2015 (UTC)
{{Age in years and days|2007|02|27|2008|03| 2}}
{{Age in years and days|2007|02|27|2008|03|2}}
{{Age in years and days|2007|02|27|2008|03|02}}
sandbox:
{{age in days|{{#ifexpr:03<02|{{#expr:2008-1}}|{{#ifexpr:03=02|{{#ifexpr: 2<27|{{#expr:2008-1}}|2008}}|2008}}}}|02|27|2008|03| 2}}
{{age in days|{{#ifexpr:03<02|{{#expr:2008-1}}|{{#ifexpr:03=02|{{#ifexpr: 2<27|{{#expr:2008-1}}|2008}}|2008}}}}|02|27|2008|03|2}}
Problem reported at Template talk:Age in days. Fix needs to be made in {{ Age in days}}, which is called by this template. – Wbm1058 ( talk) 23:44, 13 February 2016 (UTC)
Per my comment at Template talk:Age in days#Unexpected number error: spaces cause error message, I could make Module:Age work to replace this template as well, if wanted. Johnuniq ( talk) 01:29, 14 February 2016 (UTC)
When the result is about years and only one day, "years" is given in its singular form. That's what happens in World War II infobox: 6 years, 1 day. Cheers. Carlotm ( talk) 18:57, 8 May 2015 (UTC)
As noted 7 years ago but still the case - " "at the age of &0000000000000113.000000113 years, &0000000000000041.00000041" - is this Google's fault, or is it somethign we can improve?".
The issue is that this template always introduces a sort key, hidden by inline CSS, before the age; which is picked up by Google, and therefore pollutes the data displayed on Google's preview. I noticed this when searching for Emma Morano-Martinuzzi, the new oldest woman in the world, in the news at the moment - searching for her gives a Google summary of "Emma Martina Luigia Morano Martinuzzi (born 29 November 1899) is an Italian supercentenarian who is, at the age of 7009367502400000000♤116 years, 166 ...".
Any thoughts? The ideal would be a parameter or subtemplate to only include the NTS info when actually required; I suspect that, with this being used in so many places, what we might actually have to do is add a parameter or subtemplate to *exclude* the NTS info; unless someone could use a bot to go through and replace every instance which is in a sortable table with an alternative template. TSP ( talk) 14:40, 13 May 2016 (UTC)
{{age in years and days|1896|9|21|2011|4|14}}
→ 114 years, 205 days<span style="display:none" class="sortkey">7009361527840000000♠</span>114 years, 205 days
|sortable=on
is ugly. By the way, per my comment above on this page, it would be possible to replace this template with a module that is under development.
Johnuniq (
talk)
00:07, 14 May 2016 (UTC)
@ TheDJ: I changed Module:Age so {{ age in years and days/sandbox}} does not add a sort key, and created {{ age in years and days nts}} to include the sort key. The sandbox template could be used to replace the main template when we think it is ok to switch sorting off. I found {{ ayd}} which was a redirect to the current template, and changed it to redirect to {{age in years and days nts}} because {{ayd}} is used in tables of sortable durations. Johnuniq ( talk) 09:32, 22 April 2017 (UTC)
Module:Age implements a lot date/time functions, and it can emulate this template. To demonstrate, I changed {{ age in years and days/sandbox}} to use the module. Examining the testcases shows these differences.
Update: In the following, the results for {{age in years and days}} use fixed wikitext to show output from the old template. Johnuniq ( talk) 02:05, 6 May 2017 (UTC)
Difference #1
{{age in years and days|2004|2|29|2006|3|01}}
→ 2 years, 0 days{{age in years and days/sandbox|2004|2|29|2006|3|01}}
→ 2 years, 1 dayDifference #2
{{age in years and days|1 Mar 2004|28 Feb 2002}}
→ −2 years, 2 days{{age in years and days/sandbox|1 Mar 2004|28 Feb 2002}}
→ −2 years, 2 days{{age in years and days|2004|3|1|2002|2|28}}
→ -3 years, 364 days (not the wanted values, and uses a hyphen for negative){{age in years and days/sandbox|2004|3|1|2002|2|28}}
→ −2 years, 2 daysDifference #3 A space in an unexpected place causes an error in the existing template (see #Spaces cause error message above).
{{age in years and days|2007|2|1|2008|3| 1}}
→ (An error message was displayed by the old template){{age in years and days/sandbox|2007|2|1|2008|3| 1}}
→ 1 year, 29 daysThis is prompted by #Google problems above where it is proposed that the template be switched to sortable=off rather than the default, which is to include a hidden sort key before the result. Currently the module emulates the template including the fact that sortable=on is the default. It would be easy to change that default, or do anything else needed. Johnuniq ( talk) 11:29, 21 April 2017 (UTC)
2605:A000:1103:144:251E:BE4:FF27:D0B8 ( talk) 19:46, 18 November 2018 (UTC)== Using mm/dd/yyyy format for calculations ==
{{age in years and days|08/16/2016|07/24/2018}} gives Error: Need valid year, month, day results in an error, why? — Preceding unsigned comment added by 2605:a000:1103:c3:e8b6:2374:8937:4e50 ( talk • contribs) 14:17, 23 September 2018 (UTC)
{{age in years and days|2016-08-16|2018-07-24}}
→ 1 year, 342 days{{age in years and days|16 Aug 2016|24 July 2018}}
→ 1 year, 342 days{{date|08/16/2016}} gives 16 August 2016 and the format works on the date template — Preceding unsigned comment added by 2600:1:b1a6:97c5:b53a:2108:a250:3651 ( talk • contribs) 13:01, 24 September 2018 (UTC)
Well, {{date|08/16/2016}}
works perfectly, why do not use it then?, well 08/16/2016 can be parsed as 16 August 2016, because there is no 16th month.
@ Johnuniq Is it possible to display the duration between two dates with an offset (eg., minus 10 days, plus 15 days, etc.):
age in years and days|1 January 2017|1 January 2018 is expressed as 1 year, 0 days
age in years and days|date 1|date 2|parameter to add/subtract a duration is what I'm looking for.
If it's not possible, does another wiki template exist which can perform this? 156.196.150.85 ( talk) 22:44, 31 October 2018 (UTC)
{{age in years and days|1 January 2017|1 January 2018}}
→ 1 year, 0 days{{age in years and days|1 January 2017|{{extract|1 January 2018|add=-10d}}}}
→ 355 days{{age in years and days|1 January 2017|{{extract|1 January 2018|add=15d}}}}
→ 1 year, 15 days{{age in years and days|1 January 2017|{{extract|1 January 2018|add=3m 15d}}}}
→ 1 year, 105 daysHere is an example, when it's not a leap year and there's no February 29th, it will return as an error
{{age in years and days|1900|8|4|2018|2|29}}
- Error: Second date should be year, month, day will produce an error message why? (expected 117 years, 209 days), it should be corrected such like {{age in years and days|{{date|08/04/1900}}|{{date|02/29/2018}}}}
{{age in years and days|{{date|08/04/1900}}|{{date|02/29/2018}}}}
will be corrected as 117 years, 209 days
{{age in years and days|1900|8|4|2018|3|1}}
- age on 1 March 2018 will give 117 years, 209 days — Preceding
unsigned comment added by
98.31.29.4 (
talk)
{{date|02/29/2018}}
produces 1 March 2018 per
Template:Date#Known issues.
PrimeHunter (
talk)
00:26, 20 February 2019 (UTC)Also bugged with Feb 29 births, such as 118 years, 1 day (expected 118 years, 0 days) KaiHunter12 ( talk) 21:18, 24 June 2022 (UTC)
{{ayd|1904|2|29|2022|3|1}}
→ 118 years, 1 dayIt is 43,100 days from the start date to the end date, but not including the end date. Or 118 years, 1 day excluding the end date.Johnuniq ( talk) 23:52, 24 June 2022 (UTC)
Usually for
extreme old people the {{
age in years and days}}
is used, because it's easier, especially for the dead people and there first anniversary of their birth hasn't passed yet since they died
For an example
Tekla Juniewicz would've still been 116 if she were to still be alive as of 15 January 2023, however she would've been 118 years, 44 days though, when she died however on 19 August 2022 she was 116 years, 70 days, since the age of a dead person is permanent from when they died, there age does not increase after death
Age in years and days would seem more appropriate rather than just the age in years only especially for the people who died already and their first anniversary of their birth hasn't passed yet since they died which can be from 1 day to 1 year after they died.
Nabi Tajima would've still been 117 between 22 April 2018 and 3 August 2018 even if she was still alive, but the days would be from 261 to 364 rather than 260 days when she passed.
For people who died many many years ago such as George Washington when he died in December 1799 at the age of 67, if he was still alive today he would've been 292, the age in years and days wouldn't matter as much. 2603:6011:E00:4C41:0:0:0:1011 ( talk) 19:28, 15 January 2023 (UTC)
I was just reading an article on Maria Branyas. She was born on 4 March 1907. Today is March 1st. Using this template, it says that she is 115 years and 361 days.
On March 4th (3 days from now), she should be 116 years old, but 361 days + 3 is only 364.
Why is this off by a day? 2601:646:8400:C800:B7E9:CF81:2852:D240 ( talk) 14:44, 1 March 2023 (UTC)