24-Hour Clock
24-hour clock
The 24-hour clock is a timekeeping convention that expresses the time of day from 0:00 to 23:59, eliminating AM/PM ambiguity and serving as the standard in military, aviation, medical, and IT contexts.
am pm
AM (ante meridiem, Latin for "before noon") and PM (post meridiem, "after noon") are markers used in the 12-hour clock to divide the day into two halves. The hours 1:00 AM through 11:59 AM cover the morning, while 1:00 PM through 11:59 PM cover the afternoon and evening. This convention is the everyday standard in the United States, Canada, Australia, and the Philippines.
The designations 12:00 AM and 12:00 PM are logically inconsistent. By convention 12:00 PM means noon and 12:00 AM means midnight, yet calling noon "post meridiem" (after noon) contradicts the literal meaning. To avoid confusion, the aviation industry writes "12:00 noon" and "12:00 midnight" explicitly, and U.S. legal documents follow a similar practice.
When accepting user input in 12-hour format, special care is needed around the 12 o'clock hour. 12:30 AM converts to 0:30 in 24-hour time, while 12:30 PM stays 12:30. Input validation must reject illegal values such as 12:60 PM or 13:00 PM. The safest design pattern is to store all times internally in 24-hour format (0 through 23) and convert to AM/PM only at the display layer.
Was this article helpful?
24-hour clock
The 24-hour clock is a timekeeping convention that expresses the time of day from 0:00 to 23:59, eliminating AM/PM ambiguity and serving as the standard in military, aviation, medical, and IT contexts.
iso-8601
An international standard for representing dates and times in an unambiguous, machine-readable format.
timezone abbreviation
Timezone abbreviations (JST, EST, CET, etc.) are short codes representing time zones. While convenient for humans, they are ambiguous and should be avoided in software in favor of IANA timezone names.