Difference between revisions of "Template:Age in decimal years"

From blackwiki
Jump to navigation Jump to search
blackwiki>Ahecht
(create)
 
blackwiki>Ahecht
(singular=)
Line 1: Line 1:
{{#if:{{{1|}}}|{{#if:{{{3|}}}|{{#expr:({{#time: U |{{{4|{{#time: Y }}}}}-{{{5|{{#time: m }}}}}-{{{6|{{#time: d }}}}}}}-{{#time: U |{{{1}}}-{{{2|}}}-{{{3|}}}}})/31556952 round {{{round|1}}}}}|{{#expr:({{#time: U |{{{2|{{#time: Y-m-d }}}}}}}-{{#time: U |{{{1}}}}})/31556952 round {{{round|1}}}}}}}|0}} years<noinclude>
+
{{#if:{{{1|}}}|{{#if:{{{3|}}}|{{#expr:({{#time: U |{{{4|{{#time: Y }}}}}-{{{5|{{#time: m }}}}}-{{{6|{{#time: d }}}}}}}-{{#time: U |{{{1}}}-{{{2|}}}-{{{3|}}}}})/31556952 round {{{round|1}}}}}|{{#expr:({{#time: U |{{{2|{{#time: Y-m-d }}}}}}}-{{#time: U |{{{1}}}}})/31556952 round {{{round|1}}}}}}}|0}} year{{#if:{{{singular|}}}||s}}<noinclude>
 
{{documentation}}
 
{{documentation}}
 
</noinclude>
 
</noinclude>

Revision as of 19:38, 4 October 2018

0 years

Template documentation[view] [edit] [history] [purge]

Usage

Displays age in years and fractions of years. Dates can be entered in the format:

{{A.y|Start year|Start month|Start day|End year|End month|End day}}

or

{{A.y|Start date|End date}}

The |round= parameter can be used to set the number of decimal places shown (defaults to 1).

The |suffix= parameter can be used to set the suffix after the number (defaults to "years").

Examples

See also