Module:Age/doc

24

This is a Lua script to calculate the age of non-Human characters.

Usage

 * format
 * Argument number one is the format. It contains the race, (such as elf, orc, goblin), an optional "_true" postfix, and an optional "*" postfix.
 * The "_true" postfix means you gave the character's age in Terran years (365.25 days per year), so they script has to convert them to Artograchian years (376 days per year).
 * The "*" postfix means you want the years to be rounded, so it will give you 66 years instead of 66.4535 years.


 * birth-date
 * Argument number two is the birth date.


 * death-date
 * Argument number three is the death date, or the current date. It is not optional when you invoke this module. When you "invoke" the script indirectly, using Template:Age, it is once again mandatory to give the third argument. When you "invoke" the script indirectly using Template:CharacterAge however, the third argument is optional - unless you specify a date of death, it defaults to the current date, which is Template:CurrentTime, implying that the character is still alive.

Do keep in mind that the last two arguments require you to give the year in decimals. You can't just say  - you have to convert it to decimal. , because, and. You can use Template:Date3 to convert Artograchian formatted dates (with months and days) to Terran decimal years:  - or -   - equals.

Example

 * Code:
 * Result:
 * Code:
 * Result:
 * Code:
 * Result:
 * Code:
 * Result:

833.7241081451