Template:AgeDays: Difference between revisions
Jump to navigation
Jump to search
Want an adless experience? Log in or Create an account.
m (Text replace - "NoWikiTemp" to "Desc") |
m (moved from Formatting to Utility category) |
||
Line 1: | Line 1: | ||
<includeonly>{{#vardefine:AgeDaysA|{{#iferror:{{#time:n|{{{1|{{CURRENTMONTH}}}}}}}|{{#expr:{{{1|{{CURRENTMONTH}}}}} mod 12}}|{{#time:n|{{{1|{{CURRENTMONTH}}}}}}}}}}}{{#vardefine:AgeDaysB|{{#iferror:{{#time:n|{{{4|{{CURRENTMONTH}}}}}}}|{{#expr:{{{4|{{CURRENTMONTH}}}}} mod 12}}|{{#time:n|{{{4|{{CURRENTMONTH}}}}}}}}}}}{{#expr:+ {{Gregorian|month={{#var:AgeDaysB}}|day={{{5|{{CURRENTDAY}}}}}|year={{{6|{{CURRENTYEAR}}}}}}}-{{Gregorian|month={{#var:AgeDaysA}}|day={{{2|{{CURRENTDAY}}}}}|year={{{3|{{CURRENTYEAR}}}}}}}}}</includeonly> | <includeonly>{{#vardefine:AgeDaysA|{{#iferror:{{#time:n|{{{1|{{CURRENTMONTH}}}}}}}|{{#expr:{{{1|{{CURRENTMONTH}}}}} mod 12}}|{{#time:n|{{{1|{{CURRENTMONTH}}}}}}}}}}}{{#vardefine:AgeDaysB|{{#iferror:{{#time:n|{{{4|{{CURRENTMONTH}}}}}}}|{{#expr:{{{4|{{CURRENTMONTH}}}}} mod 12}}|{{#time:n|{{{4|{{CURRENTMONTH}}}}}}}}}}}{{#expr:+ {{Gregorian|month={{#var:AgeDaysB}}|day={{{5|{{CURRENTDAY}}}}}|year={{{6|{{CURRENTYEAR}}}}}}}-{{Gregorian|month={{#var:AgeDaysA}}|day={{{2|{{CURRENTDAY}}}}}|year={{{3|{{CURRENTYEAR}}}}}}}}}</includeonly> | ||
==Purpose== | ==Purpose== | ||
This template automatically calculates the time between two dates, in days. Either a two specific dates, or a past date and today's date. | This template automatically calculates the time between two dates, in days. Either a two specific dates, or a past date and today's date. | ||
Line 14: | Line 15: | ||
Again, the parameters are self-explanatory. | Again, the parameters are self-explanatory. | ||
{{Cat| | |||
{{Cat|Utility Templates}} |
Revision as of 20:01, July 28, 2012
Purpose
This template automatically calculates the time between two dates, in days. Either a two specific dates, or a past date and today's date.
Usage
To use this template for a past date and today's date, type:
{{AgeDays| Month | Day | Year }}
The parameters are self-explanatory.
To use this template to calculate the time between to specific dates, type:
{{AgeDays| Month A | Day A | Year A | Month B | Day B | Year B }}
Again, the parameters are self-explanatory.