Nh Nm Ns ± · live · units · breakdown

Add and subtract durations

Type expressions like 2h30m + 1h15m - 45s. We parse durations, apply the signs and emit the breakdown plus total seconds.

Time Arithmetic
Expression
2h 30m + 1h 15m - 45s
input
Total
3h 44m 15s
duration
Seconds
13,455
raw
Sign
positive
computed
Expression
input · syntax
Units
d = days, h = hours, m = minutes, s = seconds, ms = milliseconds
Operators
+ adds the next chunk, - subtracts it. Use spaces between tokens.
Examples
1d 6h + 90m
3h - 30m - 15s
2.5h + 250ms
output · total
Total
3h 44m 15s
13,455 seconds · 224.25 minutes · 3.74 hours
Quick Start

How parsing works

The expression splits on bare + / - then each chunk is matched with a regex picking out number + unit. Signs alternate per separator.

  1. 01

    Type chunks

    Each chunk is one or more number+unit pairs.

    Parsing accepts ISO 8601, RFC 3339, RFC 2822, and Unix epoch seconds/milliseconds. The Date constructor handles the rest with browser-engine consistency.

    chunksISO 8601RFC 3339epochlive
    in · timestampchunk · ISO
    2h 30m
    loaded · ISO 8601zone · ready
  2. 02

    Operator splits

    + / - between chunks alternate sign for the next chunk.

    All math runs in UTC internally to avoid DST landmines; presentation converts back to the user’s zone via Intl.DateTimeFormat.

    opUTC mathIntlDST-safelive
    + · optionsnext · live
    + 1h 15m
    options applied · UTCDST-safe
  3. 03

    Normalize

    Everything converts to seconds before summation.

    Output respects the chosen timezone offset (Z vs +05:30) and pads digits per ISO conventions so sorts stay chronological.

    normoffsetzone-awaresortablepadded
    norm · computedsec · ready
    9000 + 4500
    computed · instantsortable
  4. 04

    Reformat

    Total seconds → days/hours/minutes/seconds for humans.

    Copy writes via the Async Clipboard API; nothing pings a time server — the browser’s clock is the only oracle.

    formatclipboardno oracledeterministicclient-side
    ✓ · copiedready · done
    3h 44m 15s
    shipped · ready to shipsuccess
Pro tips

Time math without DST landmines

Always store UTC

Convert to local for display only. UTC storage avoids DST jumps and timezone drift in databases.

Watch leap seconds

POSIX time doesn’t count leap seconds; some systems do. Don’t use timestamps for sub-second precision across boundaries.

Prefer Temporal eventually

The Date API has many quirks. Temporal is shipping in modern engines and handles zones correctly.

Cron is timezone-tricky

Cron expressions run in the daemon’s local zone unless told otherwise. Pin a TZ explicitly for predictable runs.

ISO 8601 sorts naturally

YYYY-MM-DDTHH:mm:ss sorts correctly as a string. Don’t use US-style MM/DD/YYYY for anything machine-readable.

Beware Y2K38

Signed 32-bit Unix timestamps overflow in 2038. Use 64-bit storage end-to-end for long-lived systems.

Use Cases

When to add durations

Logs, ETA, scheduling.

ETA math

How long until everything finishes? 30m + 45m + 15m. Math runs in UTC under the hood to dodge DST jumps — local time is only for display. That means scheduling logic and date diffs survive March / November fall-back without the classic off-by-one-hour bug.

DST-safe

Cooking

Stack timers for a multi-step recipe. Browser clock is the only source — no external time server, no privacy leak, no rate limit. Pair with NTP-synced server time for high-accuracy use cases, but for human-scale work the browser clock is plenty.

UTC-correct

Project hours

Sum task durations from a planner. ISO 8601 output sorts naturally as strings, perfect for filenames (report-2026-01-15.pdf) and log lines that need chronological ordering without parsing. Drop into S3 keys for free time-bucketing.

ISO-sortable

Test runs

Total of multiple suite durations. Pairs cleanly with cron, scheduled tasks, and timestamped log analysis. The tool's output drops directly into APScheduler, Linux cron, or GitHub Actions schedule expressions without re-formatting.

spec-grade

Music sets

Plan a DJ set by adding track lengths. Output respects the chosen timezone offset (Z vs +05:30) so REST APIs and database TIMESTAMP WITH TIME ZONE columns round-trip cleanly. No ambiguity between "noon UTC" and "noon local".

zone-aware

Travel legs

Multi-leg journey time = sum of legs. Confirms the difference between epoch seconds (10 digits) and milliseconds (13 digits) before you commit code that mis-multiplies by 1000 — a classic bug in cross-language time handling.

epoch-accurate
FAQ

Frequently asked questions

Yes — 1.5h works.
If subtraction crosses zero, you'll see a leading - sign.
Yes — 1d 6h 30m all in one chunk is fine.
Not supported — convert to days first (1w = 7d).
No. Parsing is local.
Suggest a tool

Something missing?

Tell us what you need. We ship the top requests every two weeks.

Sent straight to the maintainers · no account needed
47 in queue·8 shipped this month
Request queued. Thanks!