Template:Age: Difference between revisions
Jump to navigation
Jump to search
TShinjitsu (talk | contribs) (documentation and date update.) |
TShinjitsu (talk | contribs) (woops.! 23XX not 21XX) |
||
Line 1: | Line 1: | ||
<includeonly>{{#expr:({{{4| | <includeonly>{{#expr:({{{4|2353}}})-({{{1}}})-(({{{5|4}}})<({{{2}}})or({{{5|4}}})=({{{2}}})and({{{6|2}}})<({{{3}}}))}}</includeonly><noinclude> | ||
This template returns an age from either a specified date, or the reference date for the current state of writing, which is April 2nd, | This template returns an age from either a specified date, or the reference date for the current state of writing, which is April 2nd, 2353. | ||
===Reference=== | ===Reference=== |
Latest revision as of 13:15, 11 June 2022
This template returns an age from either a specified date, or the reference date for the current state of writing, which is April 2nd, 2353.
Reference
- How to Use:
- To calculate the number of years between the reference date and an entered date
- {{age|year1|month1|day1}}
- To calculate the number of years between two dates (e.g., age at time of death):
- {{age|year1|month1|day1|year2|month2|day2}}
- Examples:
- Current Age: Ens. Smith was born on August 18, 2333.
- {{age|2333|8|18}}
- which gives you her current age: 19
- Age at a Specific Date: She was on Starbase 49 when peace was declared on 2352.12.01 CE
- {{age|2333|8|18|2352|12|1}}
- which gives you: 19
Notice that you do NOT add leading zeros for the month or day if it is a single digit.
- When using this template to calculate a person's age at death or a person's age on a specified date (rather than the person's current age), please substitute it into the page.
- Example: {{subst:age|2333|8|18|2352|12|1}}
- When a template is substituted on a page, the code will be permanently replaced with the calculated value.
- When entering dates before the Common Era, use astronomical year numbering: 1 BCE is represented by 0, 2 BCE by -1, 3 BCE by -2 etc. For example, the following expression returns the number of full years between the current stardate and the Battle of Cannae, which took place on August 2, 216 BCE:
- {{age|-215|8|2}} returns "2567"
- Note:
- This template does not check for incorrect input:
- {{age|1980|7|14|1993|6|233}} returns "12" (surplus days do not count as extra months)
- {{age|1980|7|14|1993|88|14}} returns "13" (surplus months do not count as extra years)