Skip to content
T
Tools.Town
Free Online Tools for Everyone
Date And Time

Time Format Converter Guide — 12h/24h, Duration Strings, HH:MM:SS

Convert between 12-hour AM/PM and 24-hour time, turn duration strings like '1h 30m' into seconds, and switch between HH:MM:SS and total seconds. With format reference table.

25 June 2026 4 min read By Tools.Town Team Fact Checked

Key Takeaways

  • Select '12-hour → 24-hour', type '3:45 PM', and the converter returns '15:45'
  • The converter accepts: '1h 30m 45s', '90m', '1 hour 30 minutes', '01:30:45' (HH:MM:SS), and bare integers (treated as seconds)
  • 15:45 → 3:45 PM
  • (1 × 3600) + (30 × 60) = 5,400 seconds

The six conversion modes

The Time Format Converter handles six common conversions in one tool:

ModeInput exampleOutput
12h → 24h3:45 PM15:45
24h → 12h15:453:45 PM
Duration → Seconds1h 30m 45s5445
Seconds → Duration54451h 30m 45s
HH:MM:SS → Seconds01:30:455445
Seconds → HH:MM:SS544501: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.

Advertisement

Try Time Format Converter — Free

Apply what you just learned with our free tool. No sign-up required.

Try Time Format Converter

Frequently Asked Questions

How do I convert 3:45 PM to 24-hour time?
Select '12-hour → 24-hour', type '3:45 PM', and the converter returns '15:45'. PM hours (except 12:xx PM) have 12 added; 12:xx AM becomes 0:xx.
What duration formats are accepted?
The converter accepts: '1h 30m 45s', '90m', '1 hour 30 minutes', '01:30:45' (HH:MM:SS), and bare integers (treated as seconds). Use 'Duration → Seconds' mode.
What is 15:45 in 12-hour time?
15:45 → 3:45 PM. The rule: subtract 12 from any hour > 12. Hours from 0–11 are AM (0 becomes 12 AM).
How many seconds is 1 hour 30 minutes?
(1 × 3600) + (30 × 60) = 5,400 seconds. Or use Duration → Seconds mode with '1h 30m'.

Was this guide helpful?

Your feedback helps us improve our content.

Get the best Date And Time tips & guides in your inbox

Join 25,000+ users who get our weekly date and time insights.