Template:Age in years, months, weeks and days: Difference between revisions
From AlternateWiki
m Changed protection settings for "Template:Age in years, months, weeks and days": High-risk template or module: 3324 transclusions (more info) ([Edit=Require extended confirmed access] (indefinite) [Move=Require extended confirmed access] (indefinite)) |
m 1 revision imported |
||
(No difference)
|
Latest revision as of 11:19, 8 October 2022
This template uses Lua: |
This template returns the number of months, weeks and days that have elapsed between two dates.
Usage[edit source]
{{Age in years, months, weeks and days |month1 = |day1 = |year1 = |month2 = |day2 = | year2 = }}
Note that all parameters default to the current date, so for example, the second set of parameters can be left out to calculate elapsed time since a past date:
{{Age in years, months, weeks and days |month1 = 1 |day1 = 1 |year1 = 1 }}
→ 2023 years, 7 months and 6 days
Or simply, using the simpler parameter names, compatible with {{Age in years, months and days}}:
{{Age in years, months, weeks and days |month = 1 |day = 1 |year = 1 }}
→ 2023 years, 7 months and 6 days
Alternatively, the first set of parameters can be left out to get the time left until a future date, such as the next Wikipedia Day:
{{Age in years, months, weeks and days |month2 = 1 |day2 = 15 |year2 = 2025 }}
→ 5 months, 1 week and 1 day