How a duration between two moments is worked out
A moment is a date together with a clock time. To measure the gap between two of them, each is turned into a single running count of seconds, and the two counts are subtracted.
Moment in seconds = day number × 86,400 + hours × 3,600 + minutes × 60 + seconds
Duration = end moment − start moment
The day number is a count of whole days from a fixed starting date, so it already allows for month lengths and leap years. The constant 86,400 is the number of seconds in a day (24 × 60 × 60), and 3,600 is the number in an hour. The duration in seconds is then broken back down by dividing by 86,400 for the days, dividing what is left by 3,600 for the hours, then by 60 for the minutes. The totals are the same duration expressed in one unit only: seconds ÷ 60 for total minutes, seconds ÷ 3,600 for total hours and seconds ÷ 86,400 for total days.
Going the other way, a start moment plus a duration is the start count plus the duration in seconds, converted back to a date and time.
Worked example: 4:30 pm on 18 December to 9:15 am on 4 January
An office closes at 4:30 pm on Friday 18 December 2026 and reopens at 9:15 am on Monday 4 January 2027.
- Count the days between the dates. 18 December to 4 January is 13 days to the end of December plus 4 in January: 17 days.
- Compare the clock times. 9:15 am is earlier in the day than 4:30 pm, by 7 hours 15 minutes. So the gap is 7 hours 15 minutes short of 17 full days.
- Borrow a day. Take one of the 17 days as 24 hours: 24 h − 7 h 15 min = 16 h 45 min. The duration is 16 days, 16 hours and 45 minutes.
- Totals. 16 × 24 + 16.75 = 400.75 hours, which is 24,045 minutes or 1,442,700 seconds, or about 16.698 days.
- Working days. Of the 17 dates from 18 December to 3 January, 11 are Mondays to Fridays. Measured by the clock, 256 hours 45 minutes of the closure fall on a weekday: 7.5 hours on the first Friday, ten whole weekdays, and 9.25 hours on the last Monday.
For the reverse, 100 hours after 8:00 am on Tuesday 10 November 2026: 100 hours is 4 days and 4 hours, so the answer is 12:00 noon on Saturday 14 November. Large round numbers are easier to picture once they are broken down. One million seconds is 11 days, 13 hours, 46 minutes and 40 seconds.
How daylight saving is treated
This calculator works in Coordinated Universal Time (UTC), which has no daylight saving. The dates and times you enter are treated as if every day had exactly 24 hours, so a local clock change between the two moments is not counted. That is the right behaviour for most uses, and it keeps the answer independent of where you are, but it matters when you need true elapsed time across a change.
In New South Wales the clocks went forward from 2 am to 3 am on Sunday 4 October 2026. A night shift from 10 pm on the Saturday to 7 am on the Sunday shows here as 9 hours, but only 8 hours actually passed. On Sunday 5 April 2026 the clocks went back from 3 am to 2 am, so the same shift on that weekend ran for 10 real hours. To allow for a change, subtract the shift (usually one hour) when the clocks went forward during the period, and add it when they went back. If the two moments are in different places, convert one of them first with the time zone calculator.
Leap seconds, the occasional extra second added to UTC, are also ignored, as they are by almost all everyday software.
What “working days” means here
Two figures are given because the phrase is used in two ways. Working days counts the calendar dates that are Mondays to Fridays, starting with the start date and stopping before the end date, and takes no notice of the clock times. Time on weekdays measures the part of the duration that falls between midnight starting Monday and midnight ending Friday. Neither removes public holidays, which vary by place and year, and neither knows your business hours. If a deadline is “three working days”, read the rule to see whether the first day counts.
Points to watch
- Midnight belongs to the day that is starting. 12:00 am on 5 March is the first instant of 5 March. A deadline of “midnight on the 5th” often means the end of that day, which is 12:00 am on the 6th.
- Total days is a decimal, not days and hours. 1.5 days is 1 day 12 hours, and 16.698 days is not 16 days 6.98 hours.
- Months and years are left out on purpose. They have no fixed length, so a duration in seconds cannot be turned into months without choosing a convention. The date calculator counts years, months and days between two dates and adds months to a date.
- For clock times with no dates, such as adding up lap times or converting 7 h 45 min to decimal hours, the time calculator is the simpler tool.
Related calculators
- Time calculator for adding and converting hours, minutes and seconds
- Date calculator for whole days, months and years between dates
- Time zone calculator
- Hours calculator for timesheets
- Day of the week calculator