Template:Age: Difference between revisions
(hope this works, only one way to find out) |
m (well, duh) |
||
Line 1: | Line 1: | ||
This template gives you the time in years between two dates, which you pass in like so: <nowiki>{{age|year1|month1|day1|year2|month2|day2}}</nowiki>. You can also use it to find the number of years from a certain date until whatever the current date is by passing in only the first date: <nowiki>{{age|year1|month1|day1}}</nowiki>. This second usage allows you to avoid writing an age directly somewhere and having it fall out of date over time. | <noinclude>This template gives you the time in years between two dates, which you pass in like so: <nowiki>{{age|year1|month1|day1|year2|month2|day2}}</nowiki>. You can also use it to find the number of years from a certain date until whatever the current date is by passing in only the first date: <nowiki>{{age|year1|month1|day1}}</nowiki>. This second usage allows you to avoid writing an age directly somewhere and having it fall out of date over time.</noinclude> | ||
<includeonly>{{#expr:({{{4|{{CURRENTYEAR}}}}})-({{{1}}})-(({{{5|{{CURRENTMONTH}}}}})<({{{2}}})or({{{5|{{CURRENTMONTH}}}}})=({{{2}}})and({{{6|{{CURRENTDAY}}}}})<({{{3}}}))}}{{Age sort|{{#expr:({{{4|{{CURRENTYEAR}}}}})-({{{1}}})-(({{{5|{{CURRENTMONTH}}}}})<({{{2}}})or({{{5|{{CURRENTMONTH}}}}})=({{{2}}})and({{{6|{{CURRENTDAY}}}}})<({{{3}}}))}}}}</includeonly> | <includeonly>{{#expr:({{{4|{{CURRENTYEAR}}}}})-({{{1}}})-(({{{5|{{CURRENTMONTH}}}}})<({{{2}}})or({{{5|{{CURRENTMONTH}}}}})=({{{2}}})and({{{6|{{CURRENTDAY}}}}})<({{{3}}}))}}{{Age sort|{{#expr:({{{4|{{CURRENTYEAR}}}}})-({{{1}}})-(({{{5|{{CURRENTMONTH}}}}})<({{{2}}})or({{{5|{{CURRENTMONTH}}}}})=({{{2}}})and({{{6|{{CURRENTDAY}}}}})<({{{3}}}))}}}}</includeonly> |
Revision as of 21:46, 12 November 2008
This template gives you the time in years between two dates, which you pass in like so: {{age|year1|month1|day1|year2|month2|day2}}. You can also use it to find the number of years from a certain date until whatever the current date is by passing in only the first date: {{age|year1|month1|day1}}. This second usage allows you to avoid writing an age directly somewhere and having it fall out of date over time.