Template:AMPM
Appearance
| This template is currently being deleted. This template is being removed from the pages on which it is currently used, after which it will be deleted. Please check Wikipedia:Templates for discussion/Holding cell for any additional instructions. Please do not use it on any additional pages, but do not remove it from pages if it is under deletion review. The decision to delete this template was made following this discussion initiated on 30 October 2026 at Templates for discussion. Administrators: Please review this template's instructions at Wikipedia:Templates for discussion/Holding cell before proceeding with any action. |
Returns AM or PM for the hour (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:
- {{AMPM|hour24}}
- Examples for AM hours:
- "{{AMPM|24}}" returns "AM"
- "{{AMPM|0}}" returns "AM"
- "{{AMPM|00}}" returns "AM"
- "{{AMPM|1}}" returns "AM"
- "{{AMPM|01}}" returns "AM"
- "{{AMPM|2}}" returns "AM"
- "{{AMPM|01}}" returns "AM"
- "{{AMPM|9}}" returns "AM"
- "{{AMPM|09}}" returns "AM"
- "{{AMPM|10}}" returns "AM"
- "{{AMPM|11}}" returns "AM"
- Examples for PM hours:
- "{{AMPM|12}}" returns "PM"
- "{{AMPM|13}}" returns "PM"
- "{{AMPM|14}}" returns "PM"
- "{{AMPM|15}}" returns "PM"
- "{{AMPM|21}}" returns "PM"
- "{{AMPM|22}}" returns "PM"
- "{{AMPM|23}}" returns "PM"
- See also: