This is an archive of past discussions about Template:Birth date and age. Do not edit the contents of this page. If you wish to start a new discussion or revive an old one, please do so on the current talk page.
I supported months, not months and days. When someone asks how old your baby is, you might say s/he's 14 months, or you might say s/he's almost 15 months, but you very rarely say s/he's 14 months and 22 days. You probably don't know the answer to that much precision; if you do, you probably are aware that the asker isn't interested in that much precision. If the above discussion closed as months and days, and there has been no serious objection to that close, fine. I always respect consensus. Just don't ping me and say I supported that. ―Mandruss☎01:11, 13 December 2017 (UTC)
Agreed with Mandruss; we also have a math problem: Except in rare cases we do not know the birth time, so a down-to-the-day calculation will be wrong (WP:OR) for at least part of the day (quite possible most of the day, depending on birth time). Technically such an error can be true for part of a month, but only a very small part (1/28th to 1/31st). But people do not expect absolute precision when we're talking in months; they expect way more precision when we're talking in days. — SMcCandlish☏¢ >ʌⱷ҅ᴥⱷʌ< 05:29, 13 December 2017 (UTC)
I agree that no changes to the main template should occur until thoroughly tested and agreed. However, I added some quick code to Module:Age/sandbox to implement this template for consideration. Use {{birth date and age/sandbox}} to test. The module requires valid dates and accepts input in a variety of formats. There are likely to be many templates in articles with invalid dates and switching to the module would require a fair bit of maintenance. Some examples:
{{birth date and age/sandbox|2003|2|29}} → Error: Need valid birth date: year, month, day
{{birth date and age/sandbox|2004|2|29}} → (2004-02-29) February 29, 2004 (age 20)
{{birth date and age/sandbox|1866|12|1}} → Error: Invalid birth date for calculating age
{{birth date and age/sandbox|2017|12|31}} → (2017-12-31) December 31, 2017 (age 7)
{{birth date and age/sandbox|2017|12|1}} → (2017-12-01) December 1, 2017 (age 7)
{{birth date and age/sandbox|2017|4|1}} → (2017-04-01) April 1, 2017 (age 7)
{{birth date and age/sandbox|2016|4|1}} → (2016-04-01) April 1, 2016 (age 8)
{{birth date and age/sandbox|2015|4|1}} → (2015-04-01) April 1, 2015 (age 9)
{{birth date and age/sandbox|2014|4|1}} → (2014-04-01) April 1, 2014 (age 10)
{{birth date and age/sandbox|2005|4|1}} → (2005-04-01) April 1, 2005 (age 19)
{{birth date and age/sandbox|1 Feb 1962}} → (1962-02-01) February 1, 1962 (age 62)
{{birth date and age/sandbox|1 Feb 1962|df=y}} → (1962-02-01) 1 February 1962 (age 62)
@Vanisaac, Pigsonthewing, SMcCandlish, Mandruss, and Neve-selbert: Any thoughts about the above examples? The logic currently used in the module is to show months + days if age < 1 year, or years + months if age < 3 years, otherwise years. Perhaps some royalty or similar cases warrant months + days? I agree with SMcCandlish and others that days are a problem but there may be examples where it is useful. I am planning to propose changing the template to use the module mainly so invalid dates can be tracked, but I would like to settle on what is wanted for infant ages. Johnuniq (talk) 01:24, 17 December 2017 (UTC)
Seems reasonable to me so far. The "There are likely to be many templates in articles with invalid dates and switching to the module would require a fair bit of maintenance" part is the real question, I guess. Is there anything that works now that would break afterward? Maybe do the testcases page in before/after format like usual, and throw more data at it, like c. 1920, and 20003, and '''2003''', and |2016-4-1, and [[2001]] and 1 FEB. 1962, and other things that are "errors" or actual errors, and see how consistent the live and sandbox results are. I'm thinking of the amount of hair-pulling going on over at Template talk:Lang about recent upgrades (really badass ones) to the module but which are causing a lot of temporary breakage. So much venting, so much venting ....
As for infants, I oppose doing days for reasons already given, and because it's an unnecessary complication, and per WP:NOT#INDISCRIMINATE, and per the diffuse site-wide consensus that infoboxes are already over-complicated and over-inclusive of trivia (even if we're not entirely sure what do about that or to what extent to do something about it, or exactly which things are too trivial – baby age down to the day almost certainly qualifies). — SMcCandlish☏¢ >ʌⱷ҅ᴥⱷʌ< 02:09, 17 December 2017 (UTC)
I can see "days only" up to 31 days. That seems better than the alternatives: 0 months, <1 month, or no age at all. I've yet to see any good rationale for days above 31, so I stand by my previous comments with the preceding amendment. But I confess to some confusion here. Why are we continuing this discussion as if the above close didn't happen, not to mention influencing participation to a significant degree by selective pinging? If you hope to do an end run around accepted process, I'm the wrong guy to ping. If you feel the above consensus was an unacceptable one resulting from inadequate participation (I would probably agree), start an RfC. ―Mandruss☎03:56, 17 December 2017 (UTC)
Sorry, I'm just a coder with no opinion on the RfC because I don't recall any cases of infants. I dumbly copied the ping from above, while adding the OP. I'm hoping that someone will announce a decision so I can code it. The close included "for infants under 2 years, age should automatically be displayed in months and days" but this section qualified that, and I agree there is no reason to say someone is aged 14 months and a number of days.
Re broken dates, see #Invalid dates below—there are only a small number according to the wikitext in articles at 3 November 2017. That does not count any broken instances of templates there may be that call this template.
I just extracted all occurrences that use 2017 (search for "(age 0)" to see them):
Louis Cheung{{Birth date and age|2017|3|23|df=yes}} → (2017-03-23) 23 March 2017 (age 7)
I think these are all occurrences of 2016 dates using this template. Search for "(age 1)" to see the text.
Bringing Up Bates{{birth date and age|2016|6|20}} → (2016-06-20) June 20, 2016 (age 8){{birth date and age|2016|6|20}} → (2016-06-20) June 20, 2016 (age 8)
Descendants of King George V and Mary of Teck{{Birth date and age|2016|1|16|df=yes}} → (2016-01-16) 16 January 2016 (age 8){{Birth date and age|2016|1|16|df=yes}} → (2016-01-16) 16 January 2016 (age 8)
House of Bourbon-Parma{{birth date and age|2016|04|24|df=y}} → (2016-04-24) 24 April 2016 (age 8){{birth date and age|2016|04|24|df=y}} → (2016-04-24) 24 April 2016 (age 8)
Radford family{{birth date and age|2016|7|24|df=yes}} → (2016-07-24) 24 July 2016 (age 8)
State of Matter MAAP Racing (bogus date) {{birth date and age|df=yes|2016|1|1}} → (2016-01-01) 1 January 2016 (age 9)
The Return of Superman (TV series){{Birth date and age|2016|07|12}} → (2016-07-12) July 12, 2016 (age 8){{Birth date and age|2016|07|12}} → (2016-07-12) July 12, 2016 (age 8)
19 Kids and Counting{{birth date and age|2015|4|6}} → (2015-04-06) April 6, 2015 (age 9){{birth date and age|2015|7|16}} → (2015-07-16) July 16, 2015 (age 9){{birth date and age|2015|11|5}} → (2015-11-05) November 5, 2015 (age 9)
Aamna Sharif{{Birth date and age|2015|09|14|df=y}} → (2015-09-14) 14 September 2015 (age 9)
Angela Tong{{birth_date_and_age|2015|9|23}} → (2015-09-23) September 23, 2015 (age 9)
Bei Bei{{birth date and age|2015|8|22}} → (2015-08-22) August 22, 2015 (age 9)
Billy Constable{{birth date and age|2015|8|22|1959|3|23}} → (2015-08-22) August 22, 2015 (age 9)
Bringing Up Bates{{birth date and age|2015|4|11}} → (2015-04-11) April 11, 2015 (age 9){{birth date and age|2015|5|14}} → (2015-05-14) May 14, 2015 (age 9)
Jill Duggar Dillard{{birth date and age|2015|04|6}} → (2015-04-06) April 6, 2015 (age 9)
List of giant pandas{{Birth date and age|2015|8|22}} → (2015-08-22) August 22, 2015 (age 9){{Birth date and age|2015|10|13}} → (2015-10-13) October 13, 2015 (age 9)
Radford family{{birth date and age|2015|6|3|df=yes}} → (2015-06-03) 3 June 2015 (age 9){{birth date and age|2015|6|3|df=yes}} → (2015-06-03) 3 June 2015 (age 9)
The Return of Superman (TV series){{Birth date and age|2015|04|12}} → (2015-04-12) April 12, 2015 (age 9){{Birth date and age|2015|06|10}} → (2015-06-10) June 10, 2015 (age 9){{Birth date and age|2015|10|11}} → (2015-10-11) October 11, 2015 (age 9){{Birth date and age|2015|12|04}} → (2015-12-04) December 4, 2015 (age 9){{Birth date and age|2015|12|29}} → (2015-12-29) December 29, 2015 (age 9){{Birth date and age|2015|12|30}} → (2015-12-30) December 30, 2015 (age 9)
I updated Module:Age/sandbox to try a new procedure to display ages of infants:
Show age in days if months < 1, or show months if years < 2, otherwise show years.
That is, if someone has just been born, their age would be displayed as 0 days. A day later it would (if purged!) be 1 day, then 2 days, up to the number of days in the month. Then it would switch to showing 1 month. A month later, it would show 2 months, and so on, up to 23 months. After that it would show 2 years, then 3 years, and so on.
Examining the examples from articles in the preceding section shows this would give a reasonable result, and one that would be more satisfactory than the current situation. Examples:
{{birth date and age/sandbox|2017|12|5}} → (2017-12-05) December 5, 2017 (age 7)
{{birth date and age/sandbox|2017|11|5}} → (2017-11-05) November 5, 2017 (age 7)
{{birth date and age/sandbox|2016|7|5}} → (2016-07-05) July 5, 2016 (age 8)
{{birth date and age/sandbox|2015|12|20}} → (2015-12-20) December 20, 2015 (age 9)
Per my proposals above, I have changed the template to use Module:Age. Differences that may be noticed are:
As outlined at #Infants proposal above, an age is displayed as 0 days to 31 days (if under 1 month), then as 1 month to 23 months (if under 2 years), then as 2 years or older.
If a date is invalid a big red error message is displayed and the article is placed in Category:Age error.
A birth date may be entered as year/month/day (like the old template), or may be entered as a single date. Examples:
{{birth date and age|2001|12|5}} → (2001-12-05) December 5, 2001 (age 23)
{{birth date and age|year=2001|month=12|day=5}} → (2001-12-05) December 5, 2001 (age 23)
{{birth date and age|2001-12-5}} → (2001-12-05) December 5, 2001 (age 23)
{{birth date and age|5 Dec 2001}} → (2001-12-05) December 5, 2001 (age 23)
{{birth date and age|December 5, 2001|df=yes}} → (2001-12-05) 5 December 2001 (age 23)
As mentioned, the module rejects invalid dates. It also has code to detect invalid parameters but that has not yet been enabled as it is unclear how many problems would be found. Adding |warnings=1 to the wikitext at Template:Birth date and age would add the tracking category and display a warning for unknown parameters. For compatibility with the old template, any non-empty text is equivalent to "yes" for |df=. For example, |df=yes and |df=hello give the same result (day-first format). Johnuniq (talk) 00:38, 31 March 2018 (UTC)
Invalid dates
I changed the wikitext in the third column in the following tables to show the output displayed by old template. Johnuniq (talk) 00:50, 31 March 2018 (UTC)
Following #Months and days above, I investigated what invalid birth dates exist in articles to see whether switching the template to use Module:Age would be a major problem. It appears not, as only the following have dates which would be regarded as invalid by the module. There are a handful of really broken templates where junk has found its way into the wikitext, but I haven't included them here. For brevity, the following use {{bda}} which is a redirect to {{Birth date and age}}.
Each of the following has a problem which would cause the module to show "Error: Need valid year, month, day". Parameter year=N is accepted for the year, so the module rejects "yes" as an invalid year.
An editor has raised a concern about the way this template renders
139.194.203.119(talk·contribs·WHOIS) and CuteDolphin712 (talk·contribs) seem to think that the {{birth date and age}} template's use of (age 26) instead of (age 26 years) is both problematic and incorrect. The editor has taken correcting that problem in articles. I warned the editor that this behaviour was unconstructive and suggested that a discussion should be started at the template, which is why I have started this discussion. Walter Görlitz (talk) 06:05, 1 May 2018 (UTC)
Birthday - Incorrect age extrapolated from birth date
Age calculation appears to be wrong for a person's birthday.
Age does not rollover till day after person's birthday. — Preceding unsigned comment added by 217.42.221.55 (talk) 07:21, 24 June 2018 (UTC)
Pages at Wikipedia are held in a cache: the last generated page is shown to people reading the page to avoid the overhead of needing to convert the wikitext to HTML on every view. That means ages are probably wrong by a day or so. One easy fix for a particular article is to edit the whole page then save it (publish) without making any change and with no edit summary. Johnuniq (talk) 23:21, 24 June 2018 (UTC)
Why is 6/1/1968 showing an age of 50 on 6/3/2019? Shouldn't it be 51? See Larry Centers. It correctly shows 51 on this page but not on the Larry Centers page (cut and paste Born: June 1, 1968 (age 50)). {{birth date and age|1968|6|1}} Subst (1968-06-01) June 1, 1968 (age 51) and realtime (1968-06-01) June 1, 1968 (age 56). — Preceding unsigned comment added by 2600:8800:1300:A2E:0:0:0:1002 (talk) 17:34, 4 June 2019 (UTC)
I saw it was showing 50, but I edited the infobox, added a space before the template, and it fixed it, made it 51. Must be a cache thing. (see the topic immediately preceding this one) --rogerd (talk) 18:02, 4 June 2019 (UTC)
There is no need to insert a space. See section immediately prior to this: edit whole page, click Publish, no edit summary. That does not record an edit but it updates the cache. Johnuniq (talk) 04:08, 19 August 2019 (UTC)
Thanks but of course you and I know that, whereas the "edit and publish" advice is very easy to remember and very easy to do for people who might not recall ?action=purge. Johnuniq (talk) 10:29, 19 August 2019 (UTC)
I don't even do that. There are two gadgets available:
Add a "Purge" option to the top of the page, which purges the page's cache
(S) Add a clock to the personal toolbar that displays the current time in UTC and provides a link to purge the current page (documentation)
{{birth date and age|df=no|1991|10|3}} -> (1991-10-03) 3 October 1991 (age 33)
In this example, df=no is misleading, as the code behind the parameter only checks for a non-blank value - df=no has the same effect as df=yes. I just fixed this at Vanessa Vanjie Mateo. Is there an easy way to tell if this error is common? Is it worth adding a tracking category? -- John of Reading (talk) 09:12, 25 January 2021 (UTC)
I can't search at the moment but someone at WP:VPT might know the name of the tool (template tiger?) that provides information on what parameters are in use for a specified template. Re the problem, I would far prefer to require the parameter to be valid (anything not documented giving an error) but I decided to just emulate the old template in Module:Age. That was easier and less hassle because I also did not know how many broken parameters there were, so introducing a new error might have led to a large number of cases to be investigated when in fact people had been happy with what the template showed for a considerable period. In short, I'm not sure what to do. There are many template parameters that work like this. Johnuniq (talk) 10:09, 25 January 2021 (UTC)
Problem fixing age error
The article explains why the age of a living person may be shown incorrectly, and advises dealing with this by making a 'non-edit', not changing anything. I tried this on the page Henry Stapp which hadn't updated on his birthday. Curiously this worked at the time but the next morning it had reverted to the erroneous age, I suspect as the result of the activity of a bot that had spotted my non-change and wanted to set the record straight. I've tried again now, this time adding a character with one edit and then removing it with the next. Hopefully this will work properly now. But assuming what I've just said is correct, it means that the advice in this article needs updating. --Brian Josephson (talk) 08:45, 25 March 2021 (UTC)
There must be some other explanation. You don't need to change anything in the article to fix an incorrect age: just click edit then publish with no change and no edit summary. The last edit before yours was by Monkbot on 23 December 2020 so that had no effect on the age issue. Your browser or even your ISP can cache (hold a copy) of a webpage so it doesn't have to fetch it again. Perhaps you saw the old page (from before the age was fixed) as a cached copy. Johnuniq (talk) 09:19, 25 March 2021 (UTC)
Perhaps, but do you know if there's recently been a software update that might have led to the problem? Because as I pointed out on the Henry Stapp talk page, Wikipedia seemed to be acting rather oddly at that time. --Brian Josephson (talk) 11:55, 25 March 2021 (UTC)
Again, not likely. But further to Johnuniq's post, an edit (even one that changes nothing) is more than enough; a WP:PURGE is all that is necessary. --Redrose64 🌹 (talk) 17:10, 25 March 2021 (UTC)
Agree. The null edit was a way to clear the cache in the past, but it should no longer be an issue. What exactly is the error on the subject's age with respect to his birth date? Walter Görlitz (talk) 17:23, 25 March 2021 (UTC)
It said his age was 92 when it should have been 93 (since his recent birthday). I'm still puzzled as to the way w'pedia was behaving yesterday on Firefox. I believe it recovered without my doing a restart or whatever. Did no one else notice anything? --Brian Josephson (talk) 17:53, 25 March 2021 (UTC)
Here's how it works. {{Birth date and age}} accepts input that describes a person's birth date, and subtracts that date from the current date to give their age in years, and this age gets displayed after the birth date. So far, so good. But, the age calculation is only performed when the page is re-parsed: ordinarily, this happens when somebody edits the page and saves their edit - if somebody who is not logged in merely views the page, and it was last edited on the previous day (or earlier), the person viewing the page gets shown the version as it was at the last save. The MediaWiki software provides a means for the calculation to be re-executed without editing the page, this is WP:PURGE as I mentioned above. Anybody who is not logged in who views the page after a purge will then get shown the version as it was at the time of that purge. People who are logged in who view the page will be shown the correctly-calculated age, but that action does not cause a purge - logged out users who view the page after that will still be shown the version as at the last edit (or purge). --Redrose64 🌹 (talk) 21:28, 25 March 2021 (UTC)
Yes, yes, I understand. It's a pity I didn't do a screengrab at the time the edit page was looking very odd yesterday, but I guess unless we can do time travel that's not going to be possible. Let's leave it now, anyway. --Brian Josephson (talk) 21:33, 25 March 2021 (UTC)
You and I both know, he isn’t 69, but he’s infact 79, given birth to 1949 March 29, let’s make Nigeria better, this man would probably come into power again and ruin our lives, to what end will this stupidity stop? XAit12 (talk) 14:20, 29 March 2021 (UTC)
Obviously there should be a way for an article to be flagged as following dmy or mdy date formats so age and citation templates can do the right thing. However, that requires a central design which might be pondered at WP:VPT (to see if anyone has generic ideas) and WT:Lua (to discuss a module). IMHO it's ridiculous for different modules to read and parse the entire wikitext of an article to guess about something like a date format. I think there is a second module which reads the whole page, and I'm not going to write a third. There could be a specific module that does nothing other than read/parse a page then return a table of configuration data including, for example, date = dmy. Then citation modules would use mw.loadData to get that table, and so would age modules. That would mean the article would be read and parsed once with the same logic used by any module that needs the config info. Johnuniq (talk) 01:24, 10 February 2022 (UTC)
Yes, it is possible to make a reasonable guess but it requires reading and parsing the entire wikitext of an article. That is a large overhead and maintenance burden that should be done in only one module dedicated to that purpose, not implemented in several different modules that might find it handy. Johnuniq (talk) 06:38, 22 February 2022 (UTC)
There is a guideline that states that the article and references can have different date formats, and so it would not be advisable to force it. Walter Görlitz (talk) 20:58, 28 February 2022 (UTC)