Time Calculator

Add or subtract clock times and durations across midnight.

Enter your values

Change any field. The result is recalculated on this device.

Formula, example and assumptions
Resulting time01:30:00

Starting time and direction

Duration to apply

Your result

Local calculation
Resulting time01:30:00

The result adds or subtracts a duration from the starting clock time. The day offset shows how many calendar days forward or backward the calculation crosses.

Starting time
23:30
Operation
Add
See how this is calculated

Result breakdown

Calendar-day offset
1
Check the inputs and method

These are your current inputs, not the worked example further down the page.

Starting time
23:30
Operation
Add
Hours
2
Minutes
0
Seconds
0

Method

Start seconds = 3,600h + 60m + s. Add or subtract duration seconds. Day offset = floor(total seconds/86,400); normalise the remaining seconds into 00:00:00–23:59:59.

Read the worked example and assumptions

How this calculation works

Add or subtract a duration from a clock time and see both the resulting 24-hour time and the day offset. The offset prevents a midnight crossing from being hidden. Use this for clock arithmetic; because no date or time zone is supplied, it cannot account for daylight-saving transitions.

Start seconds = 3,600h + 60m + s. Add or subtract duration seconds. Day offset = floor(total seconds/86,400); normalise the remaining seconds into 00:00:00–23:59:59.

Worked example

This example uses illustrative inputs. Your current result is shown above.

Start at 23:30:00 and add 2 hours, 0 minutes and 0 seconds. The unwrapped total is 25:30:00, so the clock result is 01:30:00 and the day offset is +1.

Assumptions and limits

  • Use a 24-hour starting time; duration minutes and seconds run from 0 to 59.
  • Every modelled day is exactly 24 hours and no daylight-saving adjustment is made.
  • A negative day offset means the resulting clock time belongs to an earlier calendar day.

Questions people ask

What does a day offset of −1 mean?

The calculation crossed midnight backward. Pair the displayed time with the previous date rather than reading it as later on the starting day.

Can I add more than 24 hours?

Yes. The hours field can span multiple days, and the separate day-offset result records the full number of midnight boundaries.

Related calculators