Military Time Rules
Simple rules for converting between 12-hour and 24-hour (military) time.
24-hour counting
24-hour time counts 00 to 23. 00 is midnight, 12 is noon. Minutes 00–59 are unchanged.
Converting to military time
- 12:00 AM → 0000. For AM times 12:xx AM, use 00:xx.
- 1:00 AM – 11:59 AM → same hour, zero-padded: 1:00 AM → 0100, 11:30 AM → 1130.
- 12:00 PM → 1200.
- 1:00 PM – 11:59 PM → add 12: 1 PM → 1300, 5 PM → 1700, 11:59 PM → 2359.
Converting to standard time
- 0000 → 12:00 AM (midnight)
- 0001 – 0059 → 12:xx AM
- 0100 – 1159 → 1:00 AM – 11:59 AM
- 1200 → 12:00 PM (noon)
- 1300 – 2359 → subtract 12: 1300 → 1:00 PM, 2359 → 11:59 PM
Accepted input formats
This converter accepts:
- Military compact:
0000,0100,1730(4-digit) and730(= 0730) as 3-digit shorthand for hours 0–9 - With separator:
00:00,17:30,00.00,17.30(hour 0–23, minutes 00–59) - 12-hour with AM/PM:
7am,7 AM,7:00 PM,07:00 PM(alsoa.m./p.m.)
Unsupported: 1700 hours, seconds, timezones, or extra text. Bare numbers like 7 without AM/PM are considered ambiguous.
Invalid examples rejected: 1360, 2560, 25:00, 17:75.
Minute-level examples
- 5:17 PM → 1717
- 17:17 → 5:17 PM
- 0515 → 5:15 AM