Advertisement

Time calculator

Enter a clock reading and a signed number of seconds. The result wraps around midnight and reports the day offset.

Calculator

A negative value moves backward. The day offset reports whole days rolled over.

Resulting time (HH:MM:SS)
01:30:00
Day offset
1

Advertisement

How this calculator works

The reading is turned into seconds after midnight, the delta is added, and the total is split into whole days and a remainder inside one day. A positive day offset means the new time is that many days later; a negative offset means it fell back into an earlier day. Every day is treated as exactly 86400 seconds, with no leap seconds and no date attached.

Formula

T = 3600h + 60m + s + delta_seconds. day_offset = floor(T / 86400), and the remainder R = T - 86400 x day_offset lies from 0 to 86399. The new clock is floor(R/3600) hours, floor((R mod 3600)/60) minutes and R mod 60 seconds.

Worked example

23:30:00 plus 7200 seconds is 01:30:00 with a day offset of 1. 00:15:00 minus 1800 seconds is 23:45:00 with a day offset of -1.

Advertisement

Frequently asked questions

Does this know about daylight saving time?

No. It is abstract clock arithmetic on 24-hour days. For real instants that cross a clock change, use the time-duration calculator, which takes explicit UTC offsets.

What does a day offset of 2 mean?

The result clock belongs to a reading two days after the original one. Only the time of day is shown, so the offset carries the missing date information.

Can the time be exactly 24:00:00?

No. Midnight is written 00:00:00 with a day offset of 1 when a positive shift reaches it. The input 24:00:00 is rejected as an invalid clock reading.

Sources

Advertisement