How to Write 8 O'Clock in 24-Hour Time
8 a.m. is 08:00 and 8 p.m. is 20:00 in 24-hour time. Learn the conversion rule, common written variants, and how to convert times in text without breaking anything else.
In 24-hour notation, 8 o'clock in the morning is written 08:00, and 8 o'clock in the evening is written 20:00. The 24-hour clock counts hours from 00 at midnight to 23 in the last hour before the next midnight, so it doesn't need "a.m." or "p.m." to tell morning from evening.
| 12-hour time | 24-hour time |
| 8:00 a.m. | 08:00 |
| 8:00 p.m. | 20:00 |
| 8:30 a.m. | 08:30 |
| 8:30 p.m. | 20:30 |
What the 12-to-24-hour conversion does to your text
Converting a time to 24-hour format changes only how the hour is written. The input is a 12-hour time with an a.m. or p.m. marker, such as "8:00 PM". The output is the same moment written as an hour from 00 to 23, such as "20:00". The minutes stay the same. The date stays the same. The time zone stays the same. The a.m./p.m. marker is removed because the hour value now carries that information. If you are editing a document, everything outside the time expression should be left exactly as it was.
How to convert 8 o'clock step by step
- 1. Check whether the time is a.m. or p.m. If there is no marker, use the surrounding context to decide, and don't guess.
- 2. For a morning time (8 a.m.), keep the hour as 8 and add a leading zero: 08.
- 3. For an evening time (8 p.m.), add 12 to the hour: 8 + 12 = 20.
- 4. Copy the minutes unchanged, separated by a colon: 08:00 or 20:00.
- 5. Delete the a.m./p.m. marker and any space in front of it.
Two hours are exceptions to the add-12 rule. 12 a.m. (midnight) becomes 00:00. 12 p.m. (noon) stays 12:00. Every other p.m. hour from 1 to 11 gets 12 added to it.
Common ways to write 08:00 and 20:00
| Style | 8 a.m. | 8 p.m. | Typical use |
| Colon with leading zero | 08:00 | 20:00 | ISO 8601, software, timetables |
| Colon without leading zero | 8:00 | 20:00 | Everyday writing in many countries |
| Compact (no colon) | 0800 | 2000 | US military and aviation style |
| With seconds | 08:00:00 | 20:00:00 | Logs, timestamps, data files |
In US military style, 0800 is usually spoken as "zero eight hundred" and 2000 as "twenty hundred." The word "hours" is often added after it. For data and software, the zero-padded form (08:00) is the safest choice. It sorts correctly as text and matches the hh:mm pattern used by ISO 8601. In American writing, "8:00" with no marker is ambiguous, because readers may assume the 12-hour clock. Use 08:00 when you mean the 24-hour reading.
Checking the result
- The hour is between 00 and 23.
- No a.m./p.m. marker remains. "20:00 PM" is a mixed format and should be corrected to "20:00".
- The minutes, and seconds if present, are identical to the original.
- Morning hours below 10 have a leading zero if your target style uses one (08:00, not 8:00).
- Midnight is 00:00 and noon is 12:00.
Converting times inside a larger document
Blind find-and-replace causes most conversion mistakes when you change many times at once. A pattern that looks for "8" will also match parts of dates, prices or version numbers. The same time can appear as "8 pm", "8PM", "8 p.m." or "8:00 P.M.", so a pattern that only covers one spelling will miss the others. The space before the marker can also vary. Some locale data and some applications insert an invisible narrow no-break space (Unicode U+202F) or a regular no-break space (U+00A0) instead of an ordinary space. A pattern that only matches a normal space will skip those times. Make your pattern account for these characters. Then review each match before replacing it.
Example (illustrative, not run here): a short Python script that parses 12-hour strings and writes them in 24-hour form.
from datetime import datetime
samples = ["8:00 AM", "8:00 PM"]
for s in samples:
t = datetime.strptime(s, "%I:%M %p")
print(s, "->", t.strftime("%H:%M"))
By the 12-to-24-hour rule, the expected output is "8:00 AM -> 08:00" and "8:00 PM -> 20:00". In Python's format codes, %H is the zero-padded 24-hour hour and %I is the 12-hour hour. %p is documented as locale-dependent, so test the script with your own system settings and input before relying on it. Strings with dotted markers like "p.m." or a non-standard space before the marker need to be normalized first.
Note on sources: this guide relies only on the standard, widely documented 12-hour and 24-hour conventions. No tool-specific documentation or test results were supplied, so confirm how your own software formats times before batch-converting important text.