⏰
Time Format & Duration Calculator
Convert 12-hour AM/PM to 24-hour military time, break down decimal hours into HH:MM:SS, and measure elapsed duration.
Time Conversion Reference Rules
12h to 24h Military Time
Exact Formula PM Hours = (H % 12) + 12
For PM times (except 12 PM), add 12 to the hour. For 12 AM (midnight), the 24-hour time is 00:00.
Example: 2:30 PM = 2 + 12 = 14:30 | 12:45 AM = 00:45
Decimal Hours to HMS
Exact Formula Mins = (Dec - Hours) × 60
Multiply the decimal remainder by 60 to obtain minutes, then multiply the remaining decimal by 60 for seconds.
Example: 2.5 hrs = 2 hrs + (0.5 * 60) = 2 hrs 30 mins
Seconds to HH:MM:SS
Exact Formula H = ⌊S/3600⌋, M = ⌊(S%3600)/60⌋
Divide total seconds by 3600 to find full hours, and take the modulo remainder for minutes and seconds.
Example: 3661 s = 1 hr (3600s), 1 min (60s), 1 sec (1s)