Template talk:FormatTime

Latest comment: 17 years ago by JPG-GR in topic Preference

Usage

edit
Single Time
{{FormatTime|hour|minute}}
Time Range
{{FormatTime|start hour|start minute|end hour|end minute}}
  • Hours must be in 24-hour format (0–24)
  • Minutes do not require two digits (05, 15, 30, etc.), but it generally makes the code clearer

Examples

edit

These examples are also used to make sure the template is working properly in most cases.

Wiki-Code Resulting Text
{{FormatTime|0|00}} Midnight
{{FormatTime|0|5}} 12:05 a.m.
{{FormatTime|0|05}} 12:05 a.m.
{{FormatTime|0|30}} 12:30 a.m.
{{FormatTime|1|00}} 1 a.m.
{{FormatTime|1|30}} 1:30 a.m.
{{FormatTime|11|30}} 11:30 a.m.
{{FormatTime|12|00}} Noon
{{FormatTime|12|30}} 12:30 p.m.
{{FormatTime|13|00}} 1 p.m.
{{FormatTime|13|30}} 1:30 p.m.
{{FormatTime|23|30}} 11:30 p.m.
{{FormatTime|24|00}} Midnight
{{FormatTime|0|00|12|00}} Midnight–Noon
{{FormatTime|12|00|24|00}} Noon–Midnight
{{FormatTime|1|30|13|30}} 1:30 a.m.–1:30 p.m.
{{FormatTime|13|30|14|45}} 1:30–2:45 p.m.
{{FormatTime|15|5|16|5}} 3:05–4:05 p.m.

Preference

edit

Any particular reason why this template utilizes "a.m." & "p.m." rather than "AM" and "PM" or similiar? Wikipedia preferences or just creator whim? Just curious. JPG-GR 01:07, 11 May 2007 (UTC)Reply