ThisCalculator

Date and time

Hours Worked Between Dates Calculator

Updated · Standard formula, shown below

The calculator for this page is switched off while it is checked. The formula is below, and the worked example in the article shows how to use it by hand.

Hours Worked Between Dates Calculator

This calculator works out the total number of hours between two dates and times, including full days and partial hours. You enter a start date and time and an end date and time, and you get back the exact elapsed hours, plus the same duration shown in minutes and in days. It is useful for timesheets, project planning, or simply knowing how long a period actually lasted.

Formula

The calculator uses the simplest possible relationship between time and hours:

Hours = (End date and time − Start date and time) × 24

Because dates are stored internally as a continuous count of milliseconds (or days with a decimal fraction), subtracting the start from the end gives the exact elapsed duration. The formula then converts that duration into the unit you asked for:

  • Hours = duration in days × 24
  • Minutes = duration in days × 24 × 60
  • Days = duration in days (including the fractional part)

No rounding is applied until the final display, so the result is exact to the precision shown.

Worked Example

Using the default values from the calculator above:

  • Start: 2025-01-06 at 09:00
  • End: 2025-01-10 at 17:30

First, count the full days between the two dates. From January 6 to January 10 is 4 days, but the start time is 09:00 and the end time is 17:30, so the actual elapsed time is not exactly 4 days.

Break it down:

  • From Jan 6 09:00 to Jan 10 09:00 = exactly 4 days
  • From Jan 10 09:00 to Jan 10 17:30 = 8.5 hours

Total = 4 days + 8.5 hours = 4 × 24 + 8.5 = 96 + 8.5 = 104.5 hours

The calculator displays 104.50 hours, 6270 minutes, and 4.35 days. The minutes figure is 104.5 × 60 = 6270, and the days figure is 104.5 ÷ 24 = 4.3542, rounded to 4.35.

When to Use This Calculator

This tool answers a very common question: “How many hours did I work between these two dates?� It is not limited to work, though. You might use it for:

  • Timesheet calculations when your pay period starts and ends mid-day
  • Estimating how long a project or task took from kickoff to completion
  • Calculating the duration of a trip, a rental, or a subscription period
  • Checking how many hours remain before a deadline or event

The key point is that it measures elapsed time, not “business hours� or “working days.� If you need only the hours you were actually on the clock (excluding lunch breaks, weekends, holidays), this basic calculator gives you the raw duration; you would then subtract your breaks manually.

How to Read the Result

The main output is the total hours, shown with two decimal places. That means 104.50 hours is exactly 104 hours and 30 minutes (since 0.50 × 60 = 30). If you see 104.25 hours, that is 104 hours and 15 minutes. The minutes output gives the same duration in a different unit, which can be easier when you need to convert to payroll units (e.g., 6270 minutes).

The days output is a decimal number of days. 4.35 days means 4 full days plus 0.35 of a day (0.35 × 24 = 8.4 hours). This is useful when you want to see the duration in larger chunks, but remember it is not the same as “calendar days� because the fractional part matters.

Common Mistakes and Pitfalls

Most errors come from mixing up formats or forgetting that a date always includes a time component. Here are the most frequent problems:

  • Entering the date without a time – If you type only a date, the calculator assumes midnight (00:00) for both start and end. That is fine if you mean whole days, but it will give a slightly different answer than if you meant 9 AM to 5 PM.
  • Swapping start and end – The result will be negative, which is meaningless for elapsed time. Always put the earlier date in the start field.
  • Confusing 12-hour and 24-hour time – The input expects 24-hour format (e.g., 17:30 for 5:30 PM). If you enter 5:30, it is interpreted as 5:30 AM.
  • Forgetting that the end time is exclusive – If you work from 9:00 to 17:00, the elapsed time is 8 hours, not 9. The calculator counts the difference, not the number of clock ticks.
  • Rounding too early – If you round the days to 4 before multiplying by 24, you get 96 hours instead of 104.5. Keep full precision until the final step.

Limitations of This Formula

The formula is purely arithmetic and does not account for any real-world complications. It ignores:

  • Time zones – if your start and end are in different zones, you must convert them to the same zone first.
  • Daylight saving time changes – a period that crosses a DST shift is not exactly 24 hours per day. The calculator treats every day as 24 hours.
  • Leap seconds – these are rare and negligible for almost all practical purposes.
  • Business hours, lunch breaks, holidays, or overtime rules – this is raw elapsed time only.

For most timesheet and project-tracking uses, these limitations are irrelevant. But if you are calculating pay, check whether your employer uses exact elapsed time or rounds to the nearest quarter-hour.

Alternatives and Related Calculations

If you need more than raw elapsed time, consider these variations:

  • Business hours calculator – counts only hours between, say, 9 AM and 5 PM on weekdays, excluding weekends and holidays.
  • Date difference in days – gives whole days, ignoring time. Useful for age or tenure calculations.
  • Time clock calculator – lets you enter multiple start/stop pairs (e.g., clock in at 8:58, out at 12:03, in at 12:58, out at 5:01) and sums them.
  • Overtime calculator – applies a multiplier (e.g., 1.5×) to hours beyond a threshold.

This simple hours-between-dates calculator is the foundation for all of those. Once you have the raw hours, you can apply any business rules you need.

Frequently Asked Questions

Does this calculator count both the start and end day?

It counts the exact difference between the two timestamps. If you start at 9 AM on Monday and end at 5 PM on Monday, you get 8 hours. If you start at 9 AM Monday and end at 9 AM Tuesday, you get 24 hours. So yes, it counts the time on both days, but only the actual hours between the two moments.

Can I use this for payroll if I work 9 to 5?

Yes, but only if you enter your actual clock-in and clock-out times. For a standard 9:00 to 17:00 shift, the result is 8 hours. If you take an unpaid lunch break, you need to subtract it manually (e.g., 8 hours minus 0.5 hours = 7.5 hours). This calculator does not automatically deduct breaks.

What if my start and end are in different time zones?

Convert both to the same time zone before entering them. For example, if you start at 9:00 AM New York time and end at 5:00 PM London time, first convert the London time to New York time (or vice versa), then enter the converted values. The calculator assumes a single time zone.

How do I handle overnight shifts?

Overnight shifts work fine as long as the end date is the next day. For a shift from 10 PM on June 1 to 6 AM on June 2, enter start as 2025-06-01T22:00 and end as 2025-06-02T06:00. The result is 8 hours.

Why does the days output show a decimal like 4.35 instead of 4 or 5?

Because the elapsed time is not a whole number of days. 4.35 days means 4 full days plus 0.35 of a day (which is 8.4 hours). If you need whole calendar days, round down to the nearest integer, but remember that loses the partial-day hours.

Can I calculate hours between two dates that are months apart?

Yes, the calculator handles any length of time. Just be aware that months have different lengths (28 to 31 days), so the result is always in hours, not in “months.� For example, from January 1 to February 1 is 31 days = 744 hours, but from February 1 to March 1 is 28 days = 672 hours in a non-leap year.

Related

Formula used
in start | Start date and time | - | 2025-01-06T09:00 | 0
in end | End date and time | - | 2025-01-10T17:30 | 0
out hours | Total hours | h | (end - start) / 3600000 | 2
out minutes | Total minutes | min | (end - start) / 60000 | 0
out days | Total days | d | (end - start) / 86400000 | 2

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.