Template:Age: Difference between revisions

From 118Wiki
Jump to navigation Jump to search
No edit summary
m (Protected "Template:Age" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)))
 
(11 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>{{#expr:({{{4|{{formatnum:{{CURRENTYEAR}}|R}}+377}}}}})-({{{1}}})-(({{{5|{{CURRENTMONTH}}}}})<({{{2}}})or({{{5|{{CURRENTMONTH}}}}})=({{{2}}})and({{{6|{{CURRENTDAY}}}}})<({{{3}}}))}}</includeonly><noinclude>
<includeonly>{{#expr:({{{4|{{CURRENTYEAR}}+377}}})-({{{1}}})-(({{{5|{{CURRENTMONTH}}}}})<({{{2}}})or({{{5|{{CURRENTMONTH}}}}})=({{{2}}})and({{{6|{{CURRENTDAY}}}}})<({{{3}}}))}}</includeonly><noinclude>
This template returns the number of full years between two specified dates. If the second set of parameters is not included, it will return the number of full years between a specified date and today's real life date. Because SB118 is set 377 years after the real life current date, you can calculate your characters' ages by subtracting 377 from their birth year and putting it in the template.
This template will automatically insert a character's current age so you don't have to update their pages each year just for their birthdays. More specifically, it returns the number of full years between the current stardate and a date you specify (for instance, a character's birthday, but it could also be any anniversary).


;Syntax<nowiki>:</nowiki>
You can also specify two dates (such as a date of birth and a date of death or some other anniversary), and the template will calculate how many years passed between those dates.
:<nowiki>{{age|year1|month1|day1|year2|month2|day2}}</nowiki> or
 
:<nowiki>{{age|year1|month1|day1}}</nowiki>
===Reference===
The current date in SB118 is based on today's real life date but set 377 years later.
:'''Today's OOC Date (US format of MM/DD/YYYY):''' {{CURRENTMONTH}}/{{CURRENTDAY}}/{{CURRENTYEAR}}
:'''Today's IC Date (US format of MM/DD/YYYY):''' {{CURRENTMONTH}}/{{CURRENTDAY}}/{{#expr:({{CURRENTYEAR}}+377)}}
 
;How to Use<nowiki>:</nowiki>
:To calculate the number of years between the current stardate and your specified date (e.g., current age):
::<nowiki>{{age|year1|month1|day1}}</nowiki>
:To calculate the number of years between two dates (e.g., age at time of death):
::<nowiki>{{age|year1|month1|day1|year2|month2|day2}}</nowiki>


; Examples<nowiki>:</nowiki>
; Examples<nowiki>:</nowiki>
: <nowiki>{{age|1989|7|23|2003|7|14}}</nowiki> returns "{{age|1989|7|23|2003|7|14}}"
:'''Current Age:''' {{n|Ayelet|Kadosh}} was born on SD 235308.18. That is, she was born on August 18, 2353. To find out how old she is based on today's stardate, you would use the following code:
: <nowiki>{{age|1989|7|23}}</nowiki> returns "{{age|1989|7|23}}"
:: <nowiki>{{age|2353|8|18}}</nowiki>
:which gives you her current age: '''{{age|2353|8|18}}'''


:For an SB118 character born on stardate 236503.14 (which translates to March 14, 2365), subtract 377 from the year to get 1988. Thus, that character's current age as of today in the SB118 universe is
:'''Age at a Specific Date:''' She was on [[Deep Space 17]] when it was captured by the [[Vaadwaur]] on SD 238706.16 (i.e., June 16, 2387). How old was she then?
::<nowiki>{{age|2353|8|18|2387|6|16}}</nowiki>
:which gives you: '''{{age|2353|8|18|2387|6|16}}'''


: <nowiki>{{age|1988|3|14}}</nowiki> returns "{{age|1988|3|14}}"
'''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.
: 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: <nowiki>{{subst:age|1989|7|23|2003|7|14}}</nowiki>
:: Example: <nowiki>{{subst:age|2353|8|18|2387|6|16}}</nowiki>
: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 elapsed since the battle of Cannae, which took place on August 2, 216 BCE:
: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:
:: <nowiki>{{age|-215|8|2}}</nowiki> returns "{{age|-215|8|2}}"
:: <nowiki>{{age|-215|8|2}}</nowiki> returns "{{age|-215|8|2}}"


Line 24: Line 37:
:: <nowiki>{{age|1980|7|14|1993|6|233}}</nowiki> returns "{{age|1980|7|14|1993|6|233}}" (surplus days do not count as extra months)
:: <nowiki>{{age|1980|7|14|1993|6|233}}</nowiki> returns "{{age|1980|7|14|1993|6|233}}" (surplus days do not count as extra months)
:: <nowiki>{{age|1980|7|14|1993|88|14}}</nowiki> returns "{{age|1980|7|14|1993|88|14}}" (surplus months do not count as extra years)
:: <nowiki>{{age|1980|7|14|1993|88|14}}</nowiki> returns "{{age|1980|7|14|1993|88|14}}" (surplus months do not count as extra years)
If you have any questions, ask [[User:TZhou|Rich]].
[[Category:Templates]]
</noinclude>
</noinclude>

Latest revision as of 20:48, 30 April 2016

This template will automatically insert a character's current age so you don't have to update their pages each year just for their birthdays. More specifically, it returns the number of full years between the current stardate and a date you specify (for instance, a character's birthday, but it could also be any anniversary).

You can also specify two dates (such as a date of birth and a date of death or some other anniversary), and the template will calculate how many years passed between those dates.

Reference

The current date in SB118 is based on today's real life date but set 377 years later.

Today's OOC Date (US format of MM/DD/YYYY): 11/30/2024
Today's IC Date (US format of MM/DD/YYYY): 11/30/2401
How to Use:
To calculate the number of years between the current stardate and your specified date (e.g., current age):
{{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: Ayelet Kadosh was born on SD 235308.18. That is, she was born on August 18, 2353. To find out how old she is based on today's stardate, you would use the following code:
{{age|2353|8|18}}
which gives you her current age: 48
Age at a Specific Date: She was on Deep Space 17 when it was captured by the Vaadwaur on SD 238706.16 (i.e., June 16, 2387). How old was she then?
{{age|2353|8|18|2387|6|16}}
which gives you: 33

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|2353|8|18|2387|6|16}}
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 "2616"
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)

If you have any questions, ask Rich.