| minthreadsleft = 4
}}
== Something's been broken by using the module rather than the template ==
Getting a ParserFunction error. See [[Template talk:User age]]. Also [[Template talk:Age]] is showing expression errors where I assume it did not previously. – [[User:Wbm1058|wbm1058]] ([[User talk:Wbm1058|talk]]) 02:22, 31 March 2022 (UTC)
:The module is fine. I replied at [[Template talk:User age]] to say that <code>format=raw</code> is needed (for example, <code><nowiki>{{age|format=raw|21 June 1984}}</nowiki></code>). That is documented at [[Template:Age]]. [[Template talk:Age]] is showing errors because of your edit at {{tl|age/sandbox}} (no problem, but that's the reason). [[User:Johnuniq|Johnuniq]] ([[User talk:Johnuniq|talk]]) 03:57, 31 March 2022 (UTC)
::OK, I reverted my sandbox edit, and updated [[Template:Age#TemplateData]] to include {{param|format}}. – [[User:Wbm1058|wbm1058]] ([[User talk:Wbm1058|talk]]) 12:03, 31 March 2022 (UTC)
:::Thanks, template data is over my head. [[User:Johnuniq|Johnuniq]] ([[User talk:Johnuniq|talk]]) 23:02, 31 March 2022 (UTC)
== A day off ==
So I noticed a few weeks ago that [[Template:2022 Russian invasion of Ukraine infobox]]'s date section is ahead by a day. I left a query about it [[User talk:Waldyrious#{{Age in years, months, weeks and days}} time zone?|here]] but that user couldn't answer my question and directed me here instead. My questions remain the same: is this module based on an early time zone where the current date would be March 7 rather than March 6, the current date in Ukraine? And is there a way to fix that so the information displayed is accurate? Tagging @[[User:Johnuniq|Johnuniq]] as the top editor here. [[User:QuietHere|QuietHere]] ([[User talk:QuietHere|talk]]) 14:54, 6 March 2023 (UTC)
:[[Template:2022 Russian invasion of Ukraine infobox]] uses the following template. It should use the second example which is exactly the same but clearer.
:*<code><nowiki>{{Age in years, months, weeks and days|day1=24|month1=2|year1=2022|day2=|month2=|year2=|duration=yes}}</nowiki></code> → {{Age in years, months, weeks and days|day1=24|month1=2|year1=2022|day2=|month2=|year2=|duration=yes}}
:*<code><nowiki>{{Age in years, months, weeks and days|24 February 2022|duration=yes}}</nowiki></code> → {{Age in years, months, weeks and days|24 February 2022|duration=yes}}
:The template is based on UTC time, the same as that shown by recent changes or histories at Wikipedia. Your original question was written at 14:29, 24 February 2023 UTC and said that the template was showing "(1 year and 1 day)" instead of exactly one year. The reason it showed an extra day during 24 Feb 2023 is the duration=yes parameter. That tells the template to include the extra day. For example, a meeting starting at 9:00am on 23 Feb and finishing at 5:00pm on 24 Feb had a duration of two days. I would have to examine the code to remind myself how the template handles times but that is rather unimportant due to my next piece of news copied from my comment at [[Template talk:Age in years and days]]: {{tq|1=The template gives the correct results at the time the page is "purged" (see [[WP:PURGE]]). Readers see a cached copy of the html to save the overhead of the server having to regenerate the page from the wikitext. The fix is edit the page then click publish without making any changes and with no edit summary. That updates template results.}} In the context of the problem you report, that is saying that the displayed years, months, weeks and days will not change until someone purges the template. [[User:Johnuniq|Johnuniq]] ([[User talk:Johnuniq|talk]]) 04:38, 7 March 2023 (UTC)
::Tried a few different purge options but they haven't made a noticeable difference. [[User:QuietHere|QuietHere]] ([[User talk:QuietHere|talk]]) 12:22, 7 March 2023 (UTC)
:::I would need a link to the page in question (is it an article? the template?) and a copy/paste of the text that is wrong. You might add one thing that you tried to fix it. Which page did you edit then click publish? [[Template:Russian invasion of Ukraine (2022–present) infobox]] currently says "(1 year, 1 week and 6 days)" which looks correct. [[User:Johnuniq|Johnuniq]] ([[User talk:Johnuniq|talk]]) 06:51, 8 March 2023 (UTC)
::::The infobox exists solely as a template call on [[Russian invasion of Ukraine (2022–present)]] so the concern should be with the template page. But I've tried purges on both pages and neither changed anything. And no, by my count that's still a day ahead. The day we're starting with is Feb. 24 which was two weeks ago on Friday. As today is Wednesday, two days before Friday, that would make it five days since last Friday, March 3. I've even tried adding an end date and it still calculates one extra day than there should be no matter what day I enter. [[User:QuietHere|QuietHere]] ([[User talk:QuietHere|talk]]) 15:39, 8 March 2023 (UTC)
{{od|4}}Here is the template from Thursday 24 February 2022 to Friday 10 March 2023, including the start and end dates (because duration=yes):
*<code><nowiki>{{Age in years, months, weeks and days|24 February 2022|10 March 2023|duration=yes}}</nowiki></code> → {{Age in years, months, weeks and days|24 February 2022|10 March 2023|duration=yes}}
It's from a Thursday to a Friday, inclusive, so there must be one day left over, as shown by the template. A [https://www.timeanddate.com/date/durationresult.html?y1=2022&m1=02&d1=24&y2=2023&m2=03&d2=10&ti=on reliable calculator] doing the same calculation says:<br>From and including: Thursday, 24 February 2022<br>To and including: Friday, 10 March 2023<br>Result: 380 days<br>It is 380 days from the start date to the end date, end date included.<br>Or 1 year, 15 days including the end date.<br>Or 12 months, 15 days including the end date.<br>That agrees with the template. [[User:Johnuniq|Johnuniq]] ([[User talk:Johnuniq|talk]]) 02:25, 9 March 2023 (UTC)
:Okay, now I've figured out where the confusion lies. February 24, 2022 was a Thursday as you said, whereas this year it was a Friday. I assumed that "one year" in this case would mean from Feb. 24 to Feb. 24 exactly, but in this case I guess it's going from one Thursday to the next and counting from there. Maybe? Or maybe it's something else like that. But this whole time, I'd been counting from Friday, Feb. 24, 2023, which is why my count was different by one. Now I'm not sure if that means that I'm wrong and the template has been right this whole time, but at least that's figured out. [[User:QuietHere|QuietHere]] ([[User talk:QuietHere|talk]]) 02:50, 9 March 2023 (UTC)
:Although that could also mean absolutely nothing. It's not very clear to me. [[User:QuietHere|QuietHere]] ([[User talk:QuietHere|talk]]) 02:57, 9 March 2023 (UTC)
::The calculation to get 1 year, 2 weeks and 1 day is like this:
::*24 Feb 2022 to 23 Feb 2023: 1 year exactly including the start and end dates
::*24 Feb 2023 to 9 March 2023: 2 weeks exactly including the start and end dates
::*10 March 2023: 1 day including the end date because duration=yes is used
::[[User:Johnuniq|Johnuniq]] ([[User talk:Johnuniq|talk]]) 03:59, 9 March 2023 (UTC)
:::Oh, I see now. I just missed you using the word "inclusive" above. So it's intentionally designed to be inclusive? Should that not be changed, or is that preferred? [[User:QuietHere|QuietHere]] ([[User talk:QuietHere|talk]]) 04:26, 9 March 2023 (UTC)
::::I explained the theory of duration=yes above. The template is doing what it was told to do. Whether or not duration=yes should be used is something to be discussed at the talk page of [[Template:2022 Russian invasion of Ukraine infobox]] with a mention at one or two article talk pages where the template is used. If duration=yes is used, the template will be a bit misleading for the first few hours each day because the full day will be included. However, the template will be correct towards the end of the day because that day should be included. All that is a bit irrelevant because, as mentioned above, purging is needed to update the display. I would include it and forget about the purging issue except for important days such as the anniversary and hopefully there won't be many more of them. [[User:Johnuniq|Johnuniq]] ([[User talk:Johnuniq|talk]]) 06:25, 9 March 2023 (UTC)
== Example for using age_generic from another module ==
<span style="display:none"> (<span class="bday">1970-02-01</span>) </span>February 1, 1970<span class="noprint ForceAgeToShow"> (age 55)</span>
</source>[[User:Johnuniq|Johnuniq]] ([[User talk:Johnuniq|talk]]) 09:07, 16 April 2025 (UTC)
::The second one is better as it produces the hCalendar. [[User:Gonnym|Gonnym]] ([[User talk:Gonnym|talk]]) 09:25, 16 April 2025 (UTC)
|