Template:TimeBetween: Difference between revisions
Appearance
mNo edit summary |
No edit summary |
||
| (4 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
<noinclude> | <includeonly>{{#switch: {{{1}}} | ||
'''Format:''' | | Y = {{timeBetween/YearsBetween|{{{2}}}|{{{3}}} }} | ||
| Error: Invalid returntype | |||
}}</includeonly><noinclude>'''Format:''' | |||
<pre> | <pre> | ||
{{timeBetween|DateTime1|DateTime2}} | {{timeBetween| ReturnType | DateTime1 | DateTime2 }} | ||
</pre> | </pre> | ||
''' | ReturnType accepts the following values, which are used to control what unit of time is returned by the function (case-sensitive): | ||
* Y | |||
<!-- * M | |||
* W | |||
* D | |||
* h | |||
* m | |||
* s --> | |||
'''Notes:''' | |||
* DateTime2 must be a later date/time than DateTime1 | |||
* The template presumes both dates/times as in the same time zone.</noinclude> | |||
Latest revision as of 02:53, 26 October 2025
Format:
{{timeBetween| ReturnType | DateTime1 | DateTime2 }}
ReturnType accepts the following values, which are used to control what unit of time is returned by the function (case-sensitive):
- Y
Notes:
- DateTime2 must be a later date/time than DateTime1
- The template presumes both dates/times as in the same time zone.