Time Calculator: Add and Subtract Durations

Add or subtract hours, minutes and seconds, evaluate a signed expression, or shift a local date and time by a duration.

Use d, h, m and s; for example, 2h 20m or 2h 20m - 40s. A blank duration means zero.
Example: 1h 15m. A blank duration means zero.
Use YYYY-MM-DD HH:MM:SS, or type now.

Result

Enter values and select Calculate.

How is this calculated?

Convert each signed duration group to seconds, then apply the selected operation in the same units.

Worked example: Add a segment and subtract a pause

Combine 2 hours and 20 minutes with 15 extra minutes, then subtract a 40-second pause. The total is 2 hours, 34 minutes and 20 seconds.

Method and limits

Use d, h, m and s for whole days, hours, minutes and seconds; blank duration means zero. Separate positive or negative groups using + or a hyphen, such as 2h 20m − 40s (type a hyphen). A day means 24 hours; no time-zone changes are applied.

How to use this calculator

  1. Choose Two durations to add or subtract duration amounts. Add a unit to every number: d, h, m or s.
  2. Choose Evaluate an expression for several signed groups, or Shift a date and time to apply a duration to one local timestamp.

Join segments and remove a pause

The expression 2h 20m - 40s + 15m equals 9,260 seconds, or 2 hours, 34 minutes and 20 seconds.

A signed group applies to all its units

In 2h - 1h 30m, the subtraction applies to the entire 1 hour and 30 minutes. The result is 30 minutes. Use a keyboard hyphen for a minus and add a plus before a new positive group.

A timestamp is not a duration

02:30 is a time reading, not 2 hours 30 minutes of duration input. Enter 2h 30m for a duration, or use a complete date and time such as 2024-02-29 23:50:00 in the starting field.

Carry across midnight when shifting a date

Adding 20m to 2024-02-29 23:50:00 produces 2024-03-01 00:10:00. Calendar boundaries are respected; offset or daylight-saving changes are not.

Frequently asked questions

Can a result be negative?
Yes. Subtracting a longer duration gives a signed result. The leading minus applies to the whole displayed duration.
What if I leave a duration blank?
A blank duration contributes zero. The starting date and time is still required when shifting a timestamp.
Can I use 1.5 hours?
Use whole quantities with units, for example 1h 30m or 90m. Decimal durations and fractional seconds are not accepted.
Does “add one day” change for a daylight-saving transition?
No. A day is exactly 24 hours for both duration arithmetic and a timestamp shift.

Common mistakes and limits

Sources & methodology

Related calculators