Duration calculator

Add or subtract ISO 8601 durations from a base time in any time zone, with millisecond precision.

Base time

Format: YYYY-MM-DD HH:mm:ss.SSS

Time zone
UTC

Offset: +00:00

Format: YYYY-MM-DD HH:mm:ss.SSS

Duration

Supports PnDTnHnMnS with optional milliseconds.

Results

Add

Base time + Duration

Date & time
2026-01-02 02:03:04.005
ISO 8601
2026-01-02T02:03:04.005Z
Unix timestamp (ms)
1767319384005
Unix timestamp (s)
1767319384

Subtract

Base time Duration

Date & time
2025-12-30 21:56:55.995
ISO 8601
2025-12-30T21:56:55.995Z
Unix timestamp (ms)
1767131815995
Unix timestamp (s)
1767131815

What is a duration?

A duration is an amount of time you add to or subtract from a base time. This calculator starts from a local date and time in a chosen time zone, then applies the same duration in both directions.

ISO 8601 examples

  • PT45M means 45 minutes.
  • P2DT6H means 2 days and 6 hours.
  • P1DT2H3M4.005S means 1 day, 2 hours, 3 minutes, and 4.005 seconds.

How this calculator works

  • Enter a base time in YYYY-MM-DD HH:mm:ss.SSS and choose the time zone you want to evaluate.
  • Enter the duration either as ISO 8601 text or with the day, hour, minute, second, and millisecond fields. The tool keeps both inputs in sync and normalizes overflow.
  • Enter positive durations only. Use the built-in add and subtract result cards to compare both directions.
  • The result cards show the adjusted local time, the UTC ISO 8601 timestamp, and Unix timestamps in seconds and milliseconds. Offsets can change around daylight saving time transitions.

How to use

Supports nonnegative ISO days, hours, minutes and seconds with up to 3 fractional digits, or integer components. A day is exactly 24 hours; local clock time may change across DST. Months, years and weeks are not supported