Code tool

Datetime Duration Calculator

Enter an ISO datetime with an offset, choose a direction and unit, then calculate the resulting instant locally.

In-browser processingNo account requiredPrivacy details ↗

Enter an offset-aware datetime and duration.

Calendar months are variable length; elapsed days are exactly 24 hours.

A QUICK WALKTHROUGH

How to use this tool

  1. Enter an ISO datetime ending in Z or containing a numeric offset.
  2. Choose add or subtract, a whole amount, and a unit.
  3. Review the ISO result and any month-end adjustment note.

Calendar and elapsed units

Years and months change calendar fields. Weeks, days, hours, minutes, and seconds use elapsed UTC time; one day is exactly 24 hours.

Offset and month-end rules

The input must include Z or a numeric offset. Calendar arithmetic is applied in the input offset, and an unavailable day is clamped to the target month’s last day.

Strict bounds

Amounts are whole numbers from 0 through 1,000,000. Results must remain within years 0001 through 9999.

GOOD TO KNOW

Common questions

Is a month a fixed number of days?

No. Months follow calendar rules and vary in length.

Can I subtract a duration?

Yes. Select Subtract.

Are values sent to a server?

No. The calculation runs locally in the browser.