Difference between revisions of "Template:TimeBetween"

From Detective Conan Wiki
 
(5 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>
'''Note:''' The template presumes both dates/times as in the same time zone.</noinclude>
+
ReturnType accepts the following values, which are used to control what unit of time is returned by the function (case-sensitive):
<includeonly>
+
* Y
{{TimeBetween/YearsBetween|{{{1}}}|{{{2}}} }}</includeonly>
+
<!-- * 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.