# Time calculator

> Exact time arithmetic: the span between two instants, or an instant plus or minus a duration, in ISO 8601 or plain shorthand. Months and years are refused honestly: they are calendar units with no single exact length.

- Tool: https://ronutz.com/en/tools/time-calculator
- Family: Encoding & data

---

## What it does

Two modes of exact time arithmetic. Between two instants: the signed span, split largest-unit-first (weeks, days, hours, minutes, seconds) and totalled fully in each unit, with the canonical ISO 8601 duration. Instant plus or minus a duration: the resulting timestamp. Durations are read in ISO 8601 (P1DT2H30M, PT90M, P1W) or plain shorthand (1d 2h 30m; 90min). Everything is computed on the UTC timeline in your browser.

## What it refuses, and why

Adding "one month" is calendar arithmetic: a month is 28 to 31 days and a year 365 or 366, so P1M has no single exact length. The tool refuses months and years with that explanation instead of silently picking a convention. Days here are exactly 24 hours and weeks exactly 7 days - exact time, stated.

## Offsets

A timestamp without an offset is read as UTC and the assumption is noted. Add Z or an explicit offset (for example -03:00) and the answer never depends on the machine the tool happens to run on.

## Standards and references

- [RFC 3339 — Date and Time on the Internet: Timestamps](https://www.rfc-editor.org/rfc/rfc3339) - timestamp format and offsets
- [ISO 8601 — durations (PnDTnHnMnS)](https://www.iso.org/iso-8601-date-and-time-format.html) - duration syntax; why P1M is calendar arithmetic
- [POSIX.1-2017 — Seconds Since the Epoch](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_16) - the UTC timeline the arithmetic runs on

## Related reading

- [Time Arithmetic and Time Zones: Exact Durations, Honest Meetings](https://ronutz.com/en/learn/time-arithmetic-and-time-zones.md): Why 'plus one month' has no exact answer, what ISO 8601 durations actually promise, and how one UTC instant becomes four different wall clocks. The DST trap, the day-shift trap, and the case for planning meetings with a real date.
