How to Identify Invalid Clock Time Notation

Learn which clock times are not real times, from 25:00 and 12:61 to 13 PM and skipped daylight saving hours, and how to check time strings reliably.

A time written on a clock face, in a form, or in a data file can look plausible and still describe a moment that does not exist. Some cases, such as 25:00 or 12:75, break the rules of the notation itself. Others, such as 13:00 PM, mix two clock systems. A third group, such as 2:30 AM on the night clocks spring forward, is correctly formatted but never happens on the local clock. This guide shows how to recognize each type and check time strings without changing valid ones.

What a time-notation check does

Validating clock notation means taking a piece of text that is supposed to represent a time of day and deciding whether it names a real, unambiguous moment under a stated convention. The input is usually a short string such as 9:05 PM, 21:05 or 2105. The output is a verdict: valid, invalid, or valid but ambiguous. Ideally it also gives a reason, so you can fix the source rather than just reject it.

The check has two layers. A format check looks only at the characters: are the hours, minutes and suffix within range for the chosen clock? A calendar check also asks whether the time exists on a particular date in a particular time zone. Most everyday errors are caught by the format check. Daylight saving gaps can only be caught by the calendar check.

Which times are not real times

Each convention has its own valid range. A time is invalid when any part falls outside that range or when two conventions are mixed. The table below lists common examples and the reason for each verdict under the stated convention.

Example | Convention assumed | Verdict | Reason
25:00 | 24-hour | Invalid | Hours run from 00 to 23
12:60 | Any | Invalid | Minutes run from 00 to 59
9:7 | Either | Malformed | Minutes are normally written with two digits (09:07)
13:00 PM | 12-hour | Invalid | 12-hour clock hours run from 1 to 12
0:45 AM | 12-hour | Invalid in strict 12-hour notation | The hour after midnight is written 12:45 AM
00:00 PM | Mixed | Invalid | A 24-hour zero hour combined with a 12-hour suffix
12:00 AM / 12:00 PM | 12-hour | Valid but often misread | AM is midnight and PM is noon; many style guides prefer "12 midnight" or "12 noon"
24:00 | 24-hour | Depends on the rule set | Some standards and systems accept it as the end of a day; many parsers reject it
23:59:60 | 24-hour with seconds | Valid only for a leap second | Seconds normally run from 00 to 59; 60 appears only when a leap second is inserted
2:30 AM on the spring-forward date | Local time with daylight saving | Does not exist locally | The clock jumps from 2:00 directly to 3:00

For the search question of which time is not a real time, the short answer is any time whose hours, minutes or seconds fall outside the convention's range, any time that mixes 12-hour and 24-hour rules, and any local time that falls in a daylight saving gap.

How to recognize each type of error

  • Out-of-range fields: an hour above 23 in 24-hour notation, above 12 in 12-hour notation, or minutes and seconds of 60 or more.
  • Mixed conventions: an AM or PM suffix attached to an hour of 0 or 13 to 23.
  • Missing context: a 12-hour time with no AM or PM, such as 7:30. It is not invalid, but it cannot be resolved without context.
  • Boundary values: 24:00, 23:59:60 and 12:00 AM/PM. These are legal only under specific rules, so treat them as cases to review rather than as automatic errors.
  • Nonexistent local times: a well-formed time that falls inside the hour skipped when daylight saving time begins. In most of the United States, clocks move from 2:00 AM straight to 3:00 AM, so times from 2:00 to 2:59 never appear on that date.
  • Repeated local times: when clocks fall back, times from 1:00 to 1:59 AM occur twice. They are real, but ambiguous unless an offset or time zone abbreviation is given.

No specific product was named, so this guide does not give menu paths. In code and spreadsheets, the relevant functions are usually called parsing, validation or date-time conversion functions. Check the documentation for your version to see whether it accepts 24:00, leap seconds and lowercase am/pm.

Why some valid-looking times fail

The 12-hour clock has no hour zero. It counts 12, 1, 2 … 11 and then switches the suffix. This is why 12:15 AM is a quarter past midnight and 0:15 AM is not standard. The 24-hour clock counts 00 to 23, so a suffix adds nothing and conflicts with hours 13 to 23.

Daylight saving time causes the other class of problem. On the changeover date the local clock does not run continuously. One hour is skipped in spring and one is repeated in autumn. A string like 02:30 is perfectly formed, but on the spring date in a zone that observes the change, it names no instant. A pattern match cannot detect this because the information is in the time zone rules, not in the characters.

Localization details that cause false errors

When time strings come from different locales or software, a correct time can fail a strict check because of the separator or spacing rather than the numbers. Normalize the input, or widen the check deliberately, before marking these as invalid.

  • Separators: some locales write times with a period (14.30) or with an "h" (14 h 30 or 14h30) instead of a colon.
  • Suffix forms: am, a.m., AM and A.M. all appear in real text, and some languages use their own markers instead of AM/PM.
  • Invisible spaces: some locale data inserts a narrow no-break space (U+202F) or a no-break space (U+00A0) between the time and AM/PM. A pattern that expects an ordinary space (U+0020) will reject "9:05 PM" even though it looks identical on screen.
  • Fullwidth or non-ASCII digits: text from some input methods uses digits that look like 0–9 but have different code points, so a check for [0-9] will not match them.

How to check time strings step by step

  • 1. Decide the convention for each field or source: 12-hour, 24-hour, or either. Record whether 24:00 and leap seconds are allowed.
  • 2. Keep the original strings. Write validation results to a new column or file so no source value is overwritten.
  • 3. Normalize only what does not change meaning. Convert U+202F and U+00A0 to an ordinary space, trim leading and trailing whitespace, and standardize the case of AM/PM. Do not pad or rewrite the numbers yet.
  • 4. Run a format check against the chosen pattern.
  • 5. For values that pass, and that come with a date and time zone, run a calendar check for daylight saving gaps and repeats.
  • 6. Classify each value as valid, invalid with a reason, or ambiguous, and review the boundary cases by hand.

Example patterns for the format check follow. They are written for common regular expression engines (PCRE, JavaScript, Python) and assume one time per string. They have not been run against your data, so test them on your own samples.

24-hour HH:MM (00:00 to 23:59, two-digit hour required):
^([01][0-9]|2[0-3]):[0-5][0-9]$

12-hour h:MM AM/PM (1:00 to 12:59, optional leading zero, optional single space):
^(0?[1-9]|1[0-2]):[0-5][0-9] ?[AaPp][Mm]$

With these patterns, 23:59 and 9:05 PM pass. 24:00, 12:60, 13:00 PM and 0:45 AM fail. If your rule set accepts 24:00 as end of day, add it as a separate alternative, such as ^(([01][0-9]|2[0-3]):[0-5][0-9]|24:00)$, rather than loosening the hour range.

For the calendar check, you need a time zone database. The illustrative Python sketch below uses the standard zoneinfo module. It treats a local time as nonexistent if converting it to UTC and back does not return the same wall-clock time. The date shown, 8 March 2026, is the second Sunday of March 2026, which is the spring-forward date under current US rules.

from datetime import datetime, timezone
from zoneinfo import ZoneInfo

def exists_locally(naive, tz_name):
    tz = ZoneInfo(tz_name)
    aware = naive.replace(tzinfo=tz)
    roundtrip = aware.astimezone(timezone.utc).astimezone(tz)
    return roundtrip.replace(tzinfo=None) == naive

# Example inputs (not verified output):
# exists_locally(datetime(2026, 3, 8, 2, 30), "America/New_York")  -> expected False
# exists_locally(datetime(2026, 3, 8, 3, 30), "America/New_York")  -> expected True

Some zones do not observe daylight saving time, such as most of Arizona. For those zones, the same 2:30 AM is valid, so always run the calendar check with the zone the time actually belongs to.

Before and after: checking a sample list

Example input, one value per line, assumed to be 12-hour times unless they have no suffix:

9:05 PM
13:00 PM
12:60 AM
0:45 AM
9:05 PM
7:30

Expected classification after normalizing the narrow no-break space and applying the 12-hour pattern. The original values are kept unchanged:

9:05 PM     valid
13:00 PM    invalid: hour above 12 with PM
12:60 AM    invalid: minutes above 59
0:45 AM     invalid: no hour 0 on a 12-hour clock (did you mean 12:45 AM?)
9:05 PM     valid after replacing U+202F with a space
7:30        ambiguous: no AM/PM

To confirm the check is working, keep a small test list that includes at least one valid example of each format, each of the invalid cases in the table above, and the boundary values your rules treat specially. Run it after any change to the pattern or the normalization step. Every entry should get the verdict you expect. Also compare the count of rows before and after processing to make sure no values were dropped or rewritten.

Limits of this guide

No product-specific documentation was supplied. Whether a given library, spreadsheet or database accepts 24:00, leap seconds, lowercase suffixes or locale-specific separators must be confirmed in that tool's documentation for the version you use. The patterns and code above are illustrative examples, not tested output.