Open main menu

mtgpq wiki β

Changes

Template:Hours formatted

688 bytes added, 06:27, 1 March 2019
Created page with "<noinclude> ==Usage== Given an integer number of hours, formats the number as a time in either a 12h or 12h clock. The first parameter is the number of hours, which may be m..."
<noinclude>
==Usage==

Given an integer number of hours, formats the number as a time in either a 12h or 12h clock.

The first parameter is the number of hours, which may be more than 24.

The second parameter (optional) is either 12 for 12h time, or 24 for 24h time. Default: 12

==Example==

The following shorthand:
<pre><nowiki>
{{Hours formatted|29}}

{{Hours formatted|29|24}}
</nowiki></pre>

Produces:

{{Hours formatted|29}}

{{Hours formatted|29|24}}

</noinclude><includeonly>{{#ifeq:{{{2|12}}}|24|<!--
-->{{#ifexpr:{{{1}}} mod 24 < 10|0}}{{#expr:{{{1}}} mod 24}}:00|<!--
-->{{#expr:{{{1}}} mod 12}}:00 {{#ifexpr:(floor({{{1}}} / 12) mod 2) = 0|AM|PM}}<!--
-->}}</includeonly>