Template:Age: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
(let's try simplifying this...) |
||
Line 1: | Line 1: | ||
<includeonly>{{#expr:( | <includeonly>{{#expr:({{CURRENTYEAR}}+377)-({{{1}}})-(({{CURRENTMONTH}})<({{{2}}})or({{CURRENTMONTH}})=({{{2}}})and({{CURRENTDAY}})<({{{3}}}))}}</includeonly><noinclude> | ||
This template returns the number of full years between the current stardate and a date you specify (for instance, a character's birthday). | This template returns the number of full years between the current stardate and a date you specify (for instance, a character's birthday). | ||
===Reference=== | ===Reference=== | ||
Line 10: | Line 8: | ||
;Syntax<nowiki>:</nowiki> | ;Syntax<nowiki>:</nowiki> | ||
:To calculate the number of years between the current stardate and your specified date (e.g., current age):<nowiki>{{age|year|month|day}}</nowiki> | |||
:To calculate the number of years between the current stardate and your specified date (e.g., current age):<nowiki>{{age| | |||
; Examples<nowiki>:</nowiki> | ; Examples<nowiki>:</nowiki> | ||
Line 17: | Line 14: | ||
:: <nowiki>{{age|2353|8|18}}</nowiki> | :: <nowiki>{{age|2353|8|18}}</nowiki> | ||
:which gives you her current age: {{age|2356|8|18}} | :which gives you her current age: {{age|2356|8|18}} | ||
Notice that you do NOT add leading zeros for the month or day if it is a single digit. | Notice that you do NOT add leading zeros for the month or day if it is a single digit. | ||
: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: | :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: |
Revision as of 09:41, 26 November 2012
This template returns the number of full years between the current stardate and a date you specify (for instance, a character's birthday).
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/27/2024
- Today's IC Date (US format of MM/DD/YYYY): 11/27/2401
- Syntax:
- To calculate the number of years between the current stardate and your specified date (e.g., current age):{{age|year|month|day}}
- Examples:
- 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: 45
Notice that you do NOT add leading zeros for the month or day if it is a single digit.
- 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 "421" (surplus days do not count as extra months)
- {{age|1980|7|14|1993|88|14}} returns "421" (surplus months do not count as extra years)