ThisCalculator

Everyday

Work Hours Between Dates & Times: How to Count

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.

Work Hours Between Dates & Times: How to Count

This calculator works out the total number of working hours between two dates and times, excluding weekends and optionally accounting for a daily break. You enter a start date/time, an end date/time, your workday start and end times, and whether to skip weekends; you get back the total work hours, plus the number of full workdays and the remaining hours.

Formula

The calculator uses a straightforward approach: it counts the number of calendar days between the start and end, multiplies by the length of the workday in hours, then subtracts the daily break time. The formula in words is:

Total work hours = (number of days) × (workday end − workday start) − (number of days × daily break in hours)

Where:

  • number of days = the difference between the end date/time and the start date/time, expressed in whole days (rounded up if there is any partial day).
  • workday start and workday end are the hours (in 24-hour format) that define a typical workday, e.g., 9 and 17 for 9 AM to 5 PM.
  • daily break is the unpaid break time in minutes, converted to hours by dividing by 60.

If the “skip weekends� option is enabled, the calculator removes Saturdays and Sundays from the day count before applying the formula. Note that this simplified version assumes the start and end times fall within the workday; if they do not, the result may be slightly off, as explained later.

Worked Example

Using the default values from the calculator above:

  • Start: January 1, 2024, 9:00 AM
  • End: January 5, 2024, 5:00 PM
  • Workday: 9 AM to 5 PM (8 hours)
  • Daily break: 60 minutes
  • Skip weekends: yes

Step 1: Find the total calendar days between start and end. From Jan 1 to Jan 5 is 4 days (Jan 1–2, 2–3, 3–4, 4–5). That is 4 × 24 = 96 hours.

Step 2: Since we skip weekends, count only weekdays. Jan 1, 2024 is a Monday, so Jan 1–5 are all weekdays. That gives 4 workdays.

Step 3: Multiply workdays by the workday length: 4 × 8 = 32 hours.

Step 4: Subtract the daily break for each day: 4 × 1 hour = 4 hours. So 32 − 4 = 28 hours.

The calculator’s formula gives the same result: (4 × 8) − (4 × 1) = 28 hours. This matches the output shown.

Why You Might Need This

People often need to count work hours between two dates for timesheets, freelance billing, project planning, or simply to estimate how long a task will take. Manually counting weekdays and subtracting breaks is tedious and error-prone, especially when the period spans multiple weeks or includes holidays. This calculator automates the arithmetic, leaving you with a reliable number.

It is particularly useful for:

  • Freelancers who bill by the hour and need to track time across a project.
  • Employees who need to estimate how many hours they will work in a given period.
  • Managers planning resource allocation for a two-week sprint.
  • Anyone curious about the actual working time between two dates, excluding weekends and breaks.

How to Use the Calculator

Enter the start and end date/time in the format YYYY-MM-DDTHH:MM (e.g., 2024-03-01T09:00). The calculator then asks for the typical workday start and end hours (in 24-hour format), the daily break in minutes, and whether to exclude weekends.

For example, if you work 8:30 AM to 5:00 PM with a 30-minute lunch, you would enter 8.5 for start, 17 for end, and 30 for break. The result is the total number of hours you would work between those dates, assuming you work every weekday.

If you want to include weekends, select “no� for the skip weekends option. The calculator will then treat every day as a workday, which might be useful for shift workers or projects that run seven days a week.

Common Mistakes and Limitations

The most common mistake is entering the end date as the last day you work, rather than the day after. If you work Monday to Friday and want to count hours through Friday, you should set the end date to Friday 5:00 PM, but the calculator counts days inclusive of the start and end. In the example above, Jan 1 to Jan 5 gives 4 days, not 5, because the difference is 4 days. If you want to include both the start and end days fully, you need to adjust the end date to the next day.

Another frequent error is mixing 12-hour and 24-hour times. Always use 24-hour format (e.g., 17 for 5 PM). Also, remember that the break time is in minutes, not hours – entering 60 instead of 1 is correct, but entering 1 would subtract only one minute per day.

This calculator assumes that your start and end times fall within the workday. If you start at 8:00 AM but your workday begins at 9:00 AM, the calculator will still count the full day as 8 hours, not 9. For precise partial-day calculations, you would need a more sophisticated tool that accounts for exact start and end times.

Additionally, the calculator does not account for holidays. If you have a public holiday in the period, you will need to subtract those hours manually.

How to Read the Result

The result is a decimal number representing total work hours. For example, 28.0 hours means 28 hours of actual working time, excluding breaks and weekends. If you need to convert this to days, divide by your daily work hours (e.g., 28 / 8 = 3.5 days).

Note that the result is rounded to one decimal place by default. For payroll or billing, you may want to round to the nearest quarter-hour (0.25, 0.5, etc.) according to your organization’s policy. The calculator gives a raw number; you can round it manually as needed.

Frequently Asked Questions

Does this calculator account for holidays?

No, it only excludes weekends if you choose that option. Public holidays are not recognized. You will need to subtract those hours manually from the result.

What if my workday start and end are different on different days?

This calculator assumes a uniform workday for every day. If your schedule varies (e.g., shorter on Fridays), you should calculate each day separately and add them up, or use an average workday length.

Can I use this for a period that spans more than one week?

Yes, the calculator handles any length of time. It counts all days between the start and end, then removes weekends if you select that option. The result will be the total work hours across the entire period.

Why is the result different if I include the end date as a full day?

Because the calculator measures the difference between the two timestamps. If you want to include the end day fully, set the end time to the end of the workday and the end date to the same day. In the example, if you set end to Jan 5 17:00, you get 4 days. If you set end to Jan 6 17:00, you get 5 days, which would include the weekend if you don’t skip it.

What if I work night shifts?

This calculator is designed for daytime schedules. For night shifts that cross midnight, you would need to split the shift into two parts or use a different method, because the calculator does not handle shifts that start on one day and end on the next.

Is the break time subtracted automatically?

Yes, you enter the daily break in minutes, and it is subtracted from each workday. If you have no break, enter 0.

Related

Formula used
in t | Start date and time | - | 2024-01-01T09:00 | 0
in d | End date and time | - | 2024-01-05T17:00 | 0
in ws | Workday start (hour) | h | 9 | 0
in we | Workday end (hour) | h | 17 | 0
in br | Daily break (minutes) | min | 60 | 0
in wk | Skip weekends | - | yes=1, no=0 | 0
out hours | Work hours | h | (wk * (floor((d - t) / 86400000) + 1) * (we - ws) - wk * (floor((d - t) / 86400000) + 1) * (br / 60)) - (wk * ((floor((d - t) / 86400000) + 1) - 1) * 0) | 1

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.