24h Times: How 24-Hour Clock Notation Works and How to Extract It Reliably
How 24-hour clock notation works, how it differs from the 12-hour clock, and what to check when extracting or converting times from text.
The 24-hour clock writes times as hours from 00 to 23 followed by minutes from 00 to 59, so 3:05 in the afternoon becomes 15:05. Most readers looking up 24h times want two things: what the notation means, and whether a tool that pulls times out of text or converts them between formats will keep the meaning intact. This review covers both and points out where the supplied material does not settle the question.
Is extracting or converting to 24-hour times right for your use?
Converting times to 24-hour form is usually worth doing when the times will be sorted, compared, stored or read by software. Every time gets one unambiguous form with no AM/PM marker to drop or misread. The main tradeoff is familiarity. Many US readers are more comfortable with the 12-hour clock, and an extraction tool that guesses wrong on an ambiguous string can produce a valid-looking time that is simply incorrect.
Keep the original 12-hour wording, or show it next to the converted value, in these cases:
- The audience is general US readers, such as on event flyers, customer emails or signage.
- The source text is ambiguous, for example "meet at 7" with no AM/PM or context.
- The output is a legal, medical or contractual record where the original wording must be preserved.
- You cannot confirm the time zone, and conversion would imply a precision the source does not have.
No specific extraction tool, product or test result was supplied for this review. The guidance below rests on how the notation is defined and on general text-processing behavior. It does not assess any particular tool's accuracy.
How 24-hour notation differs from the 12-hour clock
The 24-hour day starts at 00:00 (midnight) and runs to 23:59. Hours below 10 are normally written with a leading zero. Seconds can be added as a third field, as in 15:05:30. ISO 8601, the international date and time standard, uses this hours:minutes:seconds layout, and many technical systems follow it.
| 12-hour clock | 24-hour clock |
| 12:00 AM (midnight) | 00:00 |
| 12:30 AM | 00:30 |
| 1:00 AM | 01:00 |
| 11:59 AM | 11:59 |
| 12:00 PM (noon) | 12:00 |
| 1:00 PM | 13:00 |
| 6:45 PM | 18:45 |
| 11:59 PM | 23:59 |
The two 12 o'clock rows cause most conversion errors. 12 AM maps to 00, and 12 PM stays 12. A simple rule of "add 12 to PM hours" fails at noon unless 12 PM is handled separately.
In the US, the 24-hour clock is often called military time. In military and some aviation use it is written without a colon (1500) and spoken as "fifteen hundred." Some timetables and standards also use 24:00 to mark the end of a day, as in a shift ending at 24:00. In UTC, a leap second can appear as 23:59:60. An extractor that rejects these forms is not necessarily wrong, but it should be deliberate about whether it accepts them.
What extraction and conversion actually change
Time extraction finds substrings that look like clock times and returns them. Conversion then rewrites them into a target form. Both change the stored characters. "3:05 pm" and "15:05" are different strings that describe the same moment. This is unlike font styling or CSS display rules, which change only how text looks.
Words like "reverse", "mirror" or "font" sometimes show up in the same toolkits, but they do something quite different. Character reversal is unsafe for times. Reversing the characters of 15:50 gives 05:51, which is still a valid time but means something else, so nothing flags the error. Mirrored or stylized digits are a separate Unicode concern, covered further down.
A basic pattern for strict hh:mm or hh:mm:ss times with a colon separator looks like this:
\b([01][0-9]|2[0-3]):([0-5][0-9])(?::([0-5][0-9]))?\b
The pattern checks ranges: it rejects 25:00 and 14:75. It also has deliberate limits. It requires a leading zero, so 9:30 is missed. It does not accept 24:00, colon-free military time, or other separators. Writing out what a pattern accepts and rejects is more useful than claiming it "finds all times."
Common false positives and misses
- Look-alike number pairs: ratios (16:9), sports scores (2:1) and verse references (3:16) all match a loose hh:mm pattern.
- Durations: a video timestamp such as 1:23:45 is an elapsed time, not a time of day.
- Colon-free military time: 1500 is easily confused with a year, a quantity or a postal code, so it needs surrounding context to extract safely.
- Other separators: some locales write 15.30 or 15h30, which a colon-only pattern misses.
- Ranges: in 09:00–17:00 the dash may be a hyphen, an en dash or the word "to", and the extractor should keep the pair together.
- Time zones: suffixes such as Z or +02:00 change the meaning, so dropping them during extraction loses information.
Will extracted times stay readable and usable after copying or sharing?
Plain ASCII times like 15:05 copy, paste, search and sort reliably in most environments, because they use only basic digits and a standard colon. Trouble usually starts when the source text uses characters that look like digits or colons but are different code points.
- Stylized digits: "fancy font" generators often substitute Unicode mathematical digits (bold or double-struck variants) or fullwidth digits. These look like 0–9 but are separate characters.
- Colon look-alikes: the fullwidth colon (U+FF1A) and the ratio sign (U+2236) can stand in for the standard colon (U+003A).
- Regex engines differ: in JavaScript, \d matches only ASCII 0–9, while Python 3's default string regex \d also matches other Unicode decimal digits. The same pattern can therefore extract different results from identical text.
- Normalization: applying Unicode compatibility normalization (NFKC) before extraction maps many fullwidth and mathematical digits back to ASCII. Check the output, because normalization also changes other characters in the text.
Stylized digits also hurt accessibility. Screen readers may announce mathematical or decorative characters by name, or skip them, rather than reading them as numbers. How a given screen reader speaks a plain time such as 15:05, or a colon-free form such as 1500, depends on the software, its version and its settings. No scoped testing of any assistive technology was supplied here, so treat any claim about a specific screen reader as unverified until tested.
On web pages, the HTML time element lets you show a human-friendly time while keeping a machine-readable value in its datetime attribute. That separates what readers see from what software parses. In right-to-left text, times and time ranges usually keep their left-to-right digit order, but mixed-direction contexts can make ranges or adjacent punctuation appear reordered. Check the rendering in the actual destination rather than assuming it will hold everywhere.
Keep a plain-text equivalent, using ASCII digits and a standard colon, whenever the time will be searched, imported into a spreadsheet or calendar, read aloud by assistive technology, or passed to another system. A decorative or 12-hour rendering can sit next to it for human readers, but the plain version should be the one stored.
Gaps in the available evidence
No tool-specific documentation, accuracy figures, supported-format lists, privacy terms or test results were provided. As a result, this review cannot say how well any particular extractor handles ambiguous times, locale separators or Unicode look-alikes, or whether it retains submitted text. Before relying on a tool, run it on a small sample containing the forms you expect: 12 AM and 12 PM, single-digit hours, colon-free military time, ranges, time zone suffixes and stylized digits. Then compare its output against the conversion table above.