Changes

Jump to navigation Jump to search
Closing TfD
{{Documentation subpage}}
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
Returns the hour in 12-hours format for the hour in 24-hour format (between 0 and 24) in parameter:
* 00 (midnight at start of day) is normally 12 AM for the whole morning hour between 00:00 and 00:59.
* 01..11 (end of night and morning) is unambiguously 01..11 AM.
* 12 (noon) is normally 12 PM for the whole afternoon hour between 12:00 and 12:59.
* 13..23 (afternoon and start of night) is unambiguously 01..11 PM.
* 24 (midnight at end of day) is normally 12 AM (but the date must be adjusted when using the 12-hour format).

; Syntax<nowiki>:</nowiki>
: <tt><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|</nowiki></tt>''hour24''<tt><nowiki>}}</nowiki></tt>

; Synonym<nowiki>:</nowiki>
: <tt><nowiki>{{</nowiki>hour12<nowiki>|</nowiki></tt>''hour24''<tt><nowiki>}}</nowiki></tt>

; Examples for AM hours<nowiki>:</nowiki>
* "<tt><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|</nowiki>24<nowiki>}}</nowiki></tt>" returns "{{{{BASEPAGENAME}}|24}}"
* "<tt><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|</nowiki>0<nowiki>}}</nowiki></tt>" returns "{{{{BASEPAGENAME}}|0}}"
* "<tt><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|</nowiki>00<nowiki>}}</nowiki></tt>" returns "{{{{BASEPAGENAME}}|00}}"
* "<tt><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|</nowiki>1<nowiki>}}</nowiki></tt>" returns "{{{{BASEPAGENAME}}|1}}"
* "<tt><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|</nowiki>01<nowiki>}}</nowiki></tt>" returns "{{{{BASEPAGENAME}}|01}}"
* "<tt><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|</nowiki>2<nowiki>}}</nowiki></tt>" returns "{{{{BASEPAGENAME}}|2}}"
* "<tt><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|</nowiki>02<nowiki>}}</nowiki></tt>" returns "{{{{BASEPAGENAME}}|02}}"
* "<tt><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|</nowiki>9<nowiki>}}</nowiki></tt>" returns "{{{{BASEPAGENAME}}|9}}"
* "<tt><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|</nowiki>09<nowiki>}}</nowiki></tt>" returns "{{{{BASEPAGENAME}}|09}}"
* "<tt><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|</nowiki>10<nowiki>}}</nowiki></tt>" returns "{{{{BASEPAGENAME}}|10}}"
* "<tt><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|</nowiki>11<nowiki>}}</nowiki></tt>" returns "{{{{BASEPAGENAME}}|11}}"

; Examples for PM hours<nowiki>:</nowiki>
* "<tt><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|</nowiki>12<nowiki>}}</nowiki></tt>" returns "{{{{BASEPAGENAME}}|12}}"
* "<tt><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|</nowiki>13<nowiki>}}</nowiki></tt>" returns "{{{{BASEPAGENAME}}|13}}"
* "<tt><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|</nowiki>14<nowiki>}}</nowiki></tt>" returns "{{{{BASEPAGENAME}}|14}}"
* "<tt><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|</nowiki>15<nowiki>}}</nowiki></tt>" returns "{{{{BASEPAGENAME}}|15}}"
* "<tt><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|</nowiki>21<nowiki>}}</nowiki></tt>" returns "{{{{BASEPAGENAME}}|21}}"
* "<tt><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|</nowiki>22<nowiki>}}</nowiki></tt>" returns "{{{{BASEPAGENAME}}|22}}"
* "<tt><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>|</nowiki>23<nowiki>}}</nowiki></tt>" returns "{{{{BASEPAGENAME}}|23}}"

; Removing the padding<nowiki>:</nowiki>
* "<tt><nowiki>{{#expr:{{</nowiki>{{BASEPAGENAME}}<nowiki>|</nowiki>09<nowiki>}}}}</nowiki></tt>" returns "{{#expr:{{{{BASEPAGENAME}}|09}}}}"
; See also<nowiki>:</nowiki>
* [[Template:AMPM]]
* [[Template:HOUR]]

<includeonly>
<!-- CATEGORIES AND INTERWIKIS HERE, THANKS -->
[[Category:Date-computing templates]]

</includeonly>
Anonymous user

Navigation menu