Read and write 12-hour time

How the 12-hour time format works, how converting from 24-hour time changes the stored text, and when copied or shared times stay clear and when to keep plain 24-hour or machine-readable values.

The 12-hour clock is the everyday way of telling time in the US. It splits the day into two runs of twelve hours and marks each half with a.m. or p.m. Converting a time from 24-hour notation into this style looks like simple formatting, but it rewrites the characters in the text. That has consequences for meaning, sorting, parsing and sharing. This review covers how the notation works, what a conversion changes, and when the result holds up after it leaves the tool that produced it.

Is converting to 12-hour time right for your use?

For text that people read in the US, 12-hour time is usually the right choice. Event listings, emails, signage, schedules and customer-facing copy all fit this pattern. The format matches what most US readers expect, so they can read a time without mental conversion.

The main tradeoff is that a 12-hour time depends on its suffix. Drop or garble the a.m./p.m. marker and the time becomes ambiguous by twelve hours. The hours around midnight and noon also confuse many readers even when the marker is intact. A 24-hour value carries the whole meaning in its digits and does not have this weakness.

Plain 24-hour notation, or a standard machine-readable timestamp, is the better choice in these cases:

  • The time will be stored, sorted, filtered or imported into another system.
  • The audience is international, or works in fields that customarily use 24-hour time, such as aviation, medicine, the military or transit operations.
  • The text may pass through software that strips punctuation or unusual characters.
  • The exact moment matters legally or operationally, for example a deadline or a dosing schedule, and a misread suffix would cause harm.
  • You cannot control how the text will be displayed or re-typed downstream.

A practical compromise is to keep the canonical value in 24-hour or standard timestamp form and generate the 12-hour version only for display.

How the 12-hour format works

The rules are short, but the boundary hours are the source of most mistakes:

24-hour time | 12-hour time | Note
00:00 | 12:00 a.m. | Midnight, the start of the day
00:30 | 12:30 a.m. | Hour 00 becomes 12, with a.m.
01:00 to 11:59 | 1:00 a.m. to 11:59 a.m. | Digits unchanged, a.m. added
12:00 | 12:00 p.m. | Noon
12:45 | 12:45 p.m. | Hour 12 stays 12, with p.m.
13:00 to 23:59 | 1:00 p.m. to 11:59 p.m. | Subtract 12 from the hour, p.m. added

The rule as a procedure:

hour 0        -> 12, suffix a.m.
hours 1-11    -> unchanged, suffix a.m.
hour 12       -> 12, suffix p.m.
hours 13-23   -> hour - 12, suffix p.m.
minutes       -> unchanged

00:05  -> 12:05 a.m.
07:40  -> 7:40 a.m.
12:00  -> 12:00 p.m.
18:15  -> 6:15 p.m.
23:59  -> 11:59 p.m.

To read a 12-hour time back into 24-hour form, reverse the steps. With a.m., 12 becomes 00 and all other hours stay the same. With p.m., 12 stays 12 and you add 12 to all other hours.

Two points need extra care:

  • Many readers are unsure whether 12:00 a.m. means midnight or noon. Many US style guides recommend writing "noon" and "midnight" instead.
  • "Midnight on Friday" can be read as the start or the end of Friday. For deadlines, writing 11:59 p.m. or naming both dates is clearer.

What a conversion actually changes

Some text tools only change how characters look, for example through a CSS style or a mirrored rendering. A 12-hour conversion is different. It rewrites the stored characters: the hour digits change, the leading zero usually disappears, and new characters are added for the suffix and the space before it. Whatever copies the text receives the rewritten version, not the original 24-hour value.

The terms "reverse" and "mirror" do not apply here in the sense used by text-flipping tools. Nothing is flipped or reordered. When people talk about "reversing" a 12-hour conversion, they mean converting it back to 24-hour time. That works only if the suffix survived intact.

Formatting choices are part of the change. Common US variants include:

  • a.m. and p.m., lowercase with periods, common in edited prose
  • AM and PM, uppercase without periods, common in interfaces and signage
  • am and pm, lowercase without periods, common in informal writing
  • With or without a space between the time and the suffix
  • An on-the-hour time shortened to the hour alone, for example 3 p.m. instead of 3:00 p.m.

None of these variants changes the meaning. Pick one style and apply it consistently within a document.

Hidden character substitutions

Some tools and software libraries insert characters that look like ordinary text but are not. Locale-aware date formatting based on the Unicode CLDR data has, in some versions, placed a narrow no-break space (U+202F) between the time and the AM/PM marker instead of a regular space. On screen it looks almost identical. Code that expects a regular space may fail to parse it, and a plain-text search for "3:00 PM" typed with a normal space may not match.

Unicode also contains compatibility characters that pack the marker into one glyph, such as SQUARE AM (U+33C2) and SQUARE PM (U+33D8). These come from East Asian character sets. They are not a normal way to write English times. Fonts render them inconsistently, and they will not match searches for the ordinary letters.

If a converted time must be machine-readable, check which characters it actually contains rather than trusting its appearance. A character inspector or code-point viewer will show any non-standard spaces or symbols.

Will the result stay readable after copying or sharing?

A 12-hour time written with ordinary letters, digits, a colon, periods and a regular space is plain text. It should copy and paste like any other text. The risks come from what happens around it:

  • Lost suffix: truncated previews, narrow table columns, character limits or careless editing can cut off a.m./p.m. and leave an ambiguous number.
  • Sorting and filtering: as text, 12-hour times do not sort in chronological order. For example, 10:00 a.m. sorts before 9:00 a.m., and p.m. times mix with a.m. times. Spreadsheets and databases need a real time value or 24-hour strings to sort correctly.
  • Parsing: software that imports times may accept only certain suffix styles or spacing. Non-standard spaces or symbols, as described above, are a known cause of failures.
  • Time zones: neither format says which time zone it refers to. When readers span zones, name the zone in the text.
  • Audience expectations: readers used to 24-hour time can usually read 12-hour times but may hesitate around noon and midnight.

Accessibility and assistive technology

Standard 12-hour times use ordinary characters, so screen readers have the same text to work with as sighted readers. How a particular screen reader pronounces "3:00 p.m." compared with "3 PM" or "15:00" depends on the product, its version and its speech settings. No tested evidence was available for this review, so no claim is made about how any named screen reader handles these forms. If accessibility matters for a specific audience, test the exact format with the assistive technology those readers use.

Compatibility glyphs such as the single-character AM/PM symbols are a poor choice for accessibility. Whether assistive technology reads them correctly is uncertain, and they add risk without adding clarity.

Keeping a plain or machine-readable equivalent

Web pages can show a 12-hour time to readers while keeping a precise value for software. The HTML time element pairs the displayed text with a machine-readable datetime attribute:

<time datetime="18:15">6:15 p.m.</time>

Outside of HTML, the same principle applies. Store or send the 24-hour or full timestamp value, and treat the 12-hour text as a display layer. This matters most for calendar invites, data exports and anything another program will read.

Checklist before publishing a converted time

  • Check the boundary hours: 00:xx becomes 12:xx a.m., and 12:xx stays 12:xx p.m.
  • Use one suffix style consistently throughout the document.
  • Consider writing "noon" and "midnight" instead of 12:00 p.m. and 12:00 a.m.
  • Add the time zone when readers may be in different zones.
  • Confirm that the text contains ordinary spaces and letters if anything will parse or search it.
  • Keep the original 24-hour or timestamp value wherever the time will be stored, sorted or imported.
  • Test with the specific destination or assistive technology when it matters. One correct rendering does not prove the text will display correctly everywhere.

Gaps in this review

No specific conversion tool, destination platform or screen reader was tested for this article. The claims above rest on the conventions of the 12-hour clock and general principles of plain text and Unicode, not on measurements. Behavior in a particular app, messaging service, spreadsheet or assistive technology should be confirmed with a scoped test or that product's documentation.