Template:Timefunc/doc

This is the current revision of this page, as edited by Alex (talk | contribs) at 22:15, 15 October 2024 (Created page with "{{Documentation}} {{Invokes|Time}} Converts time values. <pre> {{timefunc|func=function|input}} </pre> ===Functions=== ;m_to_c Converts a minute value into hh:mm:ss {| class="wikitable" ! Code ! Output |- | <code><nowiki>{{timefunc|func=m_to_c|2}}</nowiki></code> || {{timefunc|func=m_to_c|2}} |- | <code><nowiki>{{timefunc|func=m_to_c|20}}</nowiki></code> || {{timefunc|func=m_to_c|20}} |- | <code><nowiki>{{timefunc|func=m_to_c|500}}</nowiki></code> || {{timefunc|func=..."). The present address (URL) is a permanent link to this version.

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
This is a documentation subpage for Template:Timefunc.
It contains usage information, categories, and other content that is not part of the original template page.
Template:Timefunc invokes function {{{func}}} in Module:Time using Lua.
Template:Timefunc invokes Module:Time using Lua.

Converts time values.

{{timefunc|func=function|input}}

Functions

m_to_c

Converts a minute value into hh:mm:ss

Code Output
{{timefunc|func=m_to_c|2}} 00:02:00
{{timefunc|func=m_to_c|20}} 00:20:00
{{timefunc|func=m_to_c|500}} 08:20:00
{{timefunc|func=m_to_c|40/60}} 00:00:40
{{timefunc|func=m_to_c|2.5}} 00:02:30
w_to_c

Converts a single value and unit into hh:mm:ss

Code Output
{{timefunc|func=w_to_c|20 minutes}} 00:20:00
{{timefunc|func=w_to_c|30 seconds}} 00:00:30
{{timefunc|func=w_to_c|5 hours}} 05:00:00
{{timefunc|func=w_to_c|250 seconds}} 00:04:10
{{timefunc|func=w_to_c|500 minutes}} 08:20:00
{{timefunc|func=w_to_c|9001 seconds}} 02:30:01
w_to_s

Converts a single value and unit into a number of seconds

Code Output
{{timefunc|func=w_to_s|20 minutes}} 1200
{{timefunc|func=w_to_s|30 seconds}} 30
{{timefunc|func=w_to_s|5 hours}} 18000
{{timefunc|func=w_to_s|500 minutes}} 30000
{{timefunc|func=w_to_s|9001 seconds}} 9001