The six conversion modes
The Time Format Converter handles six common conversions in one tool:
| Mode | Input example | Output |
|---|---|---|
| 12h → 24h | 3:45 PM | 15:45 |
| 24h → 12h | 15:45 | 3:45 PM |
| Duration → Seconds | 1h 30m 45s | 5445 |
| Seconds → Duration | 5445 | 1h 30m 45s |
| HH:MM:SS → Seconds | 01:30:45 | 5445 |
| Seconds → HH:MM:SS | 5445 | 01:30:45 |
12-hour / 24-hour conversion rules
AM hours (12-hour → 24-hour):
- 12:xx AM → 00:xx (midnight)
- 1 AM–11 AM → 01:00–11:00 (unchanged)
PM hours (12-hour → 24-hour):
- 12:xx PM → 12:xx (noon — unchanged)
- 1 PM–11 PM → 13:00–23:00 (add 12)
Memorise: PM except 12 → add 12. AM except 12 → keep. 12 AM → 0, 12 PM → 12.
Duration string formats
The converter parses flexible formats:
1h 30m 45s → 5445 seconds
1 hour 30 mins → 5400 seconds (no seconds component)
90m → 5400 seconds
01:30:45 → 5445 seconds (HH:MM:SS)
5445 → 5445 seconds (bare integer)
When to use each mode
12h ↔ 24h: scheduling tools, APIs that return 24h time, international travel.
Duration → Seconds: coding — JavaScript’s Date, Python’s datetime.timedelta, SQL interval arithmetic all work in total seconds.
Seconds → Duration: converting API response times or database values back to human-readable form.
HH:MM:SS ↔ Seconds: video editing (timecodes are HH:MM:SS) and stopwatch data analysis.
Also outputs
Each conversion shows secondary representations — e.g. a 12→24 conversion also shows the HH:MM:SS form and total seconds since midnight, so you have everything in one click.