calculator.onl
Categories50

Clock time arithmetic calculator

Add and subtract signed durations from a clock time, with midnight rollover and an optional calendar date.

A worked example

Add 15 or 45 minutes to 23:30 and check the date.

Resulting clock time01:15:00Calendar day shift1 dayResulting date2027-01-01Net signed duration+01:45:00
Enter a 24-hour time such as 23:30 or 23:30:00.125, or a 12-hour time such as 11:30 PM. Minutes and seconds run from 00 to 59. Fractions are milliseconds, with up to three decimal places.

Separate signed durations with semicolons or line breaks. Examples: +02:00; -00:15:30.250. An omitted sign means addition. Hours can exceed 23 and have up to six digits. Use a decimal dot only in seconds; empty entries are rejected.

Include a starting date to report resulting dates, or calculate only the clock and signed day shift.

Starting calendar date, from 1900-01-01 through 2200-12-31. Every intermediate result must remain in that range.

Choose 24-hour output or 12-hour output with AM/PM. This changes display only; either input clock format is accepted.

Updates as you type

Use the stated ranges and decimal precision. Enter dates as YYYY-MM-DD. List values use decimal dots; assortment columns use semicolons. All prices use the selected currency without conversion.

YOUR RESULT

Resulting clock time

01:15:00

Calculated from your inputs

Calendar day shift1 day
Resulting date2027-01-01
Net signed duration+01:45:00
The numbers, at a glance

Calculations run in your browser.
UNDERSTAND THE RESULT

A little context. A clearer answer.

↑ Back to calculator

When this calculator is useful

Find the resulting clock time and calendar day after a sequence of signed durations. The operation table makes each rollover visible. For a related calculation, try Average Time Calculator: Mean, Median & Total Duration.

What to enter

InputWhat it meansExample value
Starting clock timeEnter a 24-hour time such as 23:30 or 23:30:00.125, or a 12-hour time such as 11:30 PM. Minutes and seconds run from 00 to 59. Fractions are milliseconds, with up to three decimal places.23:30:00
Signed durations · HH:MM:SS.sssSeparate signed durations with semicolons or line breaks. Examples: +02:00; -00:15:30.250. An omitted sign means addition. Hours can exceed 23 and have up to six digits. Use a decimal dot only in seconds; empty entries are rejected.+02:00:00; -00:15:00
Calendar dateInclude a starting date to report resulting dates, or calculate only the clock and signed day shift.Include a starting date
Starting dateStarting calendar date, from 1900-01-01 through 2200-12-31. Every intermediate result must remain in that range.Dec 31, 2026
Clock displayChoose 24-hour output or 12-hour output with AM/PM. This changes display only; either input clock format is accepted.24-hour clock

How the calculation works

  1. Convert the starting clock and each duration to exact integer milliseconds.
  2. Apply durations in order. Divide the unwrapped clock by 86400000 and take the floor for its signed day shift; the remainder is the new clock time.
  3. If a starting date is supplied, add the day shift using the Gregorian calendar. Show the net signed duration and each intermediate result.
The formulaT = t₀ + Σdᵢ; D = floor(T/86400000); t = T − 86400000D

A worked example

Our example: 2026-12-31 at 23:30, plus 02:00 and minus 00:15, ends at 01:15 on 2027-01-01. The day shift is +1 and the net duration is +01:45:00.

Example you can load

What to enter
Result for this example · Resulting clock time01:15:00

This is a fixed example; changing the form above does not change these numbers.

Assumptions & limits

Civil-calendar arithmetic without time zones, daylight-saving changes or leap seconds. One day is exactly 24 hours. Accepts 1–1000 durations, up to 999999:59:59.999 each; integer milliseconds remain exact. With a date, every intermediate date must stay within 1900–2200. This does not measure elapsed time across a real clock change.

Frequently asked questions

How does subtraction across midnight work?

At 00:00, subtracting one millisecond gives 23:59:59.999 with day shift −1. The floor rule handles negative values rather than truncating them toward zero.

Will a daylight-saving transition change the result?

No. This tool uses a uniform 24-hour civil day and has no time-zone input. Use a tool with actual time-zone rules for elapsed travel or shift times across clock changes.

Can a duration be longer than a day?

Yes. For example, +49:00 advances two full days and one hour. Clock input hours are limited to 00–23, but duration hours can have up to six digits.