Difference between revisions of "Template:FormatTime"

From blackwiki
Jump to navigation Jump to search
imported>CyberSkull
(|{{PAGENAME}})
imported>TheMuuj
m (foolproofing: adding padleft to allow for 4|5 instead of 4|05 for 4:05)
Line 1: Line 1:
<includeonly>{{#ifexpr:({{{1|0}}}=0 or {{{1|0}}}=24) and {{{2|0}}}=0|Midnight|{{#ifexpr:{{{1|0}}}=12 and {{{2|0}}}=0|Noon|{{#expr:({{{1|0}}}+11)mod 12+1}}{{#ifexpr:{{{2|0}}}>0|<nowiki>:</nowiki>{{{2|0}}}}}{{#ifexpr:{{{3|-1}}}<0 or ({{{1|0}}}<12)!=({{{3|0}}}<12)|<nowiki> </nowiki>{{#ifexpr:{{{1|0}}}<12|a.m.|p.m.}}}}}}}}<!--range-->{{#if:{{{3|}}}|–{{#ifexpr:({{{3|0}}}=0 or {{{3|0}}}=24) and {{{4|0}}}=0|Midnight|{{#ifexpr:{{{3|0}}}=12 and {{{4|0}}}=0|Noon|{{#expr:({{{3|0}}}+11)mod 12+1}}{{#ifexpr:{{{4|0}}}>0|<nowiki>:</nowiki>{{{4|0}}}}} {{#ifexpr:{{{3|0}}}<12|a.m.|p.m.}}}}}}}}</includeonly><noinclude>
+
<includeonly>{{#ifexpr:({{{1|0}}}=0 or {{{1|0}}}=24) and {{{2|0}}}=0|Midnight|{{#ifexpr:{{{1|0}}}=12 and {{{2|0}}}=0|Noon|{{#expr:({{{1|0}}}+11)mod 12+1}}{{#ifexpr:{{{2|0}}}>0|<nowiki>:</nowiki>{{padleft:{{{2|00}}}|2|0}}}}{{#ifexpr:{{{3|-1}}}<0 or ({{{1|0}}}<12)!=({{{3|0}}}<12)|<nowiki> </nowiki>{{#ifexpr:{{{1|0}}}<12|a.m.|p.m.}}}}}}}}</includeonly><noinclude>
 +
<!--the code below is for time ranges-->
 +
</noinclude><includeonly>{{#if:{{{3|}}}|–{{#ifexpr:({{{3|0}}}=0 or {{{3|0}}}=24) and {{{4|0}}}=0|Midnight|{{#ifexpr:{{{3|0}}}=12 and {{{4|0}}}=0|Noon|{{#expr:({{{3|0}}}+11)mod 12+1}}{{#ifexpr:{{{4|0}}}>0|<nowiki>:</nowiki>{{padleft:{{{4|00}}}|2|0}}}} {{#ifexpr:{{{3|0}}}<12|a.m.|p.m.}}}}}}}}</includeonly><noinclude>
 
{{esoteric}}
 
{{esoteric}}
  

Revision as of 07:44, 30 August 2006


Instructions

See the Template talk:FormatTime for information regarding the use of this template.