Elapsed time between two clock readings
Elapsed time is easy to get wrong when the two readings come from different places or different sides of a daylight-saving change. Subtracting clock times by hand treats 22:00 and 09:00 as eleven hours apart, even when a clock change fell between them. This page avoids that by requiring an explicit offset on each timestamp. It converts both to instants on the UTC timeline, subtracts them and returns the number of seconds. The seconds figure is the one number that does not depend on any local rule, and you can convert it to hours and minutes yourself in a few steps.
Duration as the gap between two epoch values
The formula is seconds = endEpochSeconds - startEpochSeconds, where each epoch value counts seconds since 1970-01-01T00:00:00Z. Timestamps need a full date, a time with seconds, and an offset such as Z, +02:00 or -05:00. Fractional seconds are accepted up to three digits. To turn the seconds into a readable duration, divide by 3,600 for hours, take the remainder, divide that by 60 for minutes and keep what is left as seconds. Days are 86,400 seconds each. Because the page works on instants, a duration that crosses midnight, a month boundary or a leap day needs no special handling.
Two and a half hours across midnight UTC
The page opens with a start of 2024-01-01T23:00:00Z and an end of 2024-01-02T01:30:00Z. The two times are 2 hours and 30 minutes apart even though the date changes at midnight in between. In seconds that is 2 × 3,600 + 30 × 60 = 9,000, and the page returns 9000. Crossing midnight is where manual subtraction often goes wrong, since 01:30 minus 23:00 appears negative before you add 24 hours. A duration across a full day is 86,400 seconds, so a start of 2024-01-01T00:00:00Z and an end of 2024-01-02T00:00:00Z returns exactly that number.
Offsets from different regions
Suppose a flight leaves at 2024-05-01T10:30:00-07:00 and lands at 2024-05-02T06:15:00+02:00. The departure instant is 17:30 UTC on May 1, and the arrival instant is 04:15 UTC on May 2. The difference is 10 hours and 45 minutes, which the page reports as 38700 seconds. Notice that the local clock readings seem to suggest 19 hours and 45 minutes by simple subtraction of dates and times, which is wrong because the offsets differ by nine hours. Entering each time with its own offset is the right way to compare departures and arrivals across zones.
A daylight-saving boundary
In the United States, clocks moved forward at 2:00 a.m. local time on March 10, 2024. A shift that begins at 2024-03-09T22:00:00-05:00 and ends at 2024-03-10T09:00:00-04:00 looks like 11 hours on a wall clock, but only 10 hours passed, because one hour of local time did not exist. In UTC the start is 03:00 on March 10 and the end is 13:00, and the page returns 36000 seconds. The offset changed from -05:00 to -04:00 because of the clock change, and you must write the offset that was in force at each moment. A time zone name is not accepted, so look up the offset for the specific date. The reverse event happens in autumn, when a clock repeats an hour and a night shift becomes an hour longer than the wall clock suggests. In both cases the UTC subtraction gives the true time that elapsed, which is the figure you want for pay and for machine run times.
Recording work time and event length
Duration in seconds suits logs and timesheets that need an unambiguous figure. A start of 08:45 and an end of 17:15 on the same date and offset gives 30,600 seconds, or 8 hours and 30 minutes. Subtract the unpaid break separately if one applies, since the page measures the whole span between the two instants. For events that cross midnight or a region boundary, a timestamp with an offset keeps the record accurate even if someone later reads it in another time zone. Keep the timestamp strings with the result so that a reviewer can repeat the subtraction. A one-minute rounding habit adds up quickly: a crew of ten with a 15 minute error in each recorded shift misstates 150 minutes of paid time per day. Exact timestamps remove that drift.
Order of the inputs
The end must not come before the start, and the page expects a non-negative duration. If you reverse the two timestamps, the result is rejected rather than returned as a negative number. When you only know that two events happened but not their order, enter the earlier one as the start. A duration of zero is allowed and means that both timestamps describe the same instant, even if they are written with different offsets, such as 12:00:00Z and 14:00:00+02:00. That equivalence is a useful test of whether two records refer to the same moment. It is also a handy way to confirm that a pair of logs from different servers, each in its own offset, describe one event.
Leap seconds and precision
The page assumes that every day has 86,400 seconds, which is how JavaScript dates and most operating systems keep time. Leap seconds, which UTC has occasionally inserted at the end of June or December, are excluded, and the seconds field of a timestamp must be between 00 and 59. For nearly all scheduling, billing and logging, that approximation is fine. Precision work with atomic time scales, such as satellite timing or scientific observations, needs a source that tracks leap seconds. Millisecond digits are accepted, but the result is shown in seconds.
Why zone names are rejected for durations
The page does not accept time zone names such as America/New_York, because a name alone does not fix the offset without a rule database. It does not account for business hours, holidays or breaks. It reports only the span between two instants, in seconds. The supported range follows the date library, covering years 0001 through 9999. For a duration measured in calendar months or years, use a page designed for those units, since months and years do not have fixed lengths in seconds.