BCBetter Calculators

Hours Between Dates Calculator

Calculate the total number of hours between two dates and times.

🧮

Enter your values and click Calculate

How It Works

The calculator constructs two JavaScript Date objects from the separate year, month, day, hour, and minute inputs, then subtracts the start timestamp from the end timestamp to get total elapsed milliseconds. That raw millisecond difference is converted to each output unit by dividing by the appropriate constant: 3,600,000 ms per hour for total hours, 60,000 ms per minute for total minutes, and 86,400,000 ms per day for total days. The formatted hours-and-minutes output uses Math.floor on the total hours and the modulo of milliseconds within an hour to isolate the remaining minutes. The calculation inherently handles all calendar complexities — month boundaries, leap years, and daylight saving time changes are managed by the Date object.

Examples

Overnight Shift
A shift from Jan 15 at 10 PM to Jan 16 at 6 AM crossing midnight.
Result: 8 hr 0 min (8 hours exactly).
Multi-Day Project
From Jan 15 at 9 AM to Jan 17 at 3 PM.
Result: 54 hours, 3,240 minutes, 2.25 days.
Month-Spanning Duration
From Jan 28 at 2 PM to Feb 3 at 11 AM.
Result: 141 hours, 8,460 minutes, 5.875 days.

Frequently Asked Questions

How do I enter times in 24-hour format?
Use 0 for midnight, 9 for 9 AM, 12 for noon, 13 for 1 PM, 17 for 5 PM, and 23 for 11 PM. Simply add 12 to any PM hour past noon. For example, 3 PM = 15, 8 PM = 20.
How do I calculate hours between dates that span multiple days?
Enter the full date and time for both the start and end. The calculator handles any duration. For example, from January 1 at 9:00 AM to January 5 at 5:00 PM is 104 hours (4 days × 24 hours + 8 hours).
Can I use this to calculate billable hours?
Yes. Enter your exact start and end times and use the total hours output. For billing in quarter-hour increments, round the decimal hours up to the nearest 0.25. For example, 3.1 hours billed in 15-minute increments would become 3.25 billable hours.

Related Calculators