Advertisement

Time difference calculator

Compare two moments with their own dates, clock times and UTC offsets. The difference is the real elapsed time between them.

Calculator

Signed hours east of UTC: -4 for Eastern daylight time, -5 for Eastern standard time, 0 for UTC.

Signed hours east of UTC. Give each instant its own offset so daylight-saving clock changes are counted.

Difference in seconds
30,600
Difference in decimal hours
8.500000
Difference (HH:MM:SS)
08:30:00

Advertisement

How this calculator works

The two readings are placed on a uniform second scale using their dates, clock fields and signed UTC offsets. The later reading minus the earlier one is the difference. Supplying the offset yourself means the answer reflects the actual instants, not the browser or server time zone, and a span across a seasonal clock change is measured correctly.

Formula

U(x) = 86400 x (O(date) - 1) + 3600h + 60m + s - offset_seconds. difference = U(end) - U(start), reported in seconds, then divided by 3600 for decimal hours and split into hours, minutes and seconds.

Worked example

From 09:00 to 17:30 on the same day with the same offset is 30600 seconds, 8.500000 hours, or 08:30:00. An end earlier than the start in UTC is reported as an error rather than a negative difference.

Advertisement

Frequently asked questions

Is this the same as comparing two time zones?

It compares two instants that each carry an offset. To convert a single moment between zones, give both readings the same UTC instant but different offsets and the difference will be zero.

What if my two readings are on different dates?

Enter each date and offset separately. The dates are part of the calculation, so a span across midnight is measured as the real elapsed time.

Why not just subtract the clock times?

Clock subtraction ignores the date and any offset change, so an overnight span would look negative and a daylight-saving night would be off by an hour.

Sources

Advertisement