Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:Time: Difference between revisions

Template page
Zai (talk | contribs)
mNo edit summary
can now return hundredths (by default) or miliseconds (if second parameter is ms)
 
Line 1: Line 1:
<includeonly>{{#ifexpr:trunc({{#expr:({{{1|0}}}/1000/60/60)}})|{{padleft:{{#expr:trunc({{#expr:{{{1|0}}}/1000/60/60}})}}|2}}:}}{{padleft:{{#expr:trunc({{#expr:({{{1|0}}}/1000/60)mod60}})}}|2}}:{{padleft:{{#expr:trunc({{#expr:({{{1|0}}}/1000)mod60}})}}|2}}.{{#invoke:String|sub|{{padleft:{{{1|0}}}|3}}|-3}}</includeonly><noinclude>
<includeonly>{{#ifexpr:trunc({{#expr:({{{1|0}}}/1000/60/60)}})|{{padleft:{{#expr:trunc({{#expr:{{{1|0}}}/1000/60/60}})}}|2}}:}}{{padleft:{{#expr:trunc({{#expr:({{{1|0}}}/1000/60)mod 60}})}}|2}}:{{padleft:{{#expr:trunc({{#expr:({{{1|0}}}/1000)mod60}})}}|2}}.{{#ifeq:{{lc:{{{2|}}}}}|ms|{{padleft:{{#expr:{{{1|0}}}mod1000}}|3|0}}|{{padleft:{{#expr:trunc(({{{1|0}}}mod1000)/10)}}|2|0}}}}</includeonly><noinclude>
 
== Usage ==
== Usage ==
Enter the time in ms as parameter. Example:
Enter the time in ms as parameter. If there's a second parameter ms, it will return it in miliseconds, if not, it will return it in hundredths. Example:
<pre>
<pre>
{{Time|12345}}
{{Time|12345}} (no second parameter)
</pre>
</pre>
will give {{Time|12345}}
will give {{Time|12345}} (hundredths).
<pre>
{{Time|12345|ms}} (second parameter is ms)
</pre>
will give {{Time|12345|ms}} (miliseconds).
</noinclude>
</noinclude>

Latest revision as of 17:21, 31 January 2026


Usage[edit]

Enter the time in ms as parameter. If there's a second parameter ms, it will return it in miliseconds, if not, it will return it in hundredths. Example:

{{Time|12345}} (no second parameter)

will give 00:12.34 (hundredths).

{{Time|12345|ms}} (second parameter is ms)

will give 00:12.345 (miliseconds).

Contents