# How many hours between times?

Counts the hours and minutes between two clock times, as decimal hours for timesheets, with an end time before the start counted on the next day.

- Page: https://www.acalculator.org/days/hours-calculator
- JSON spec: https://www.acalculator.org/days/hours-calculator.json
- Version: 703ff6bb992e

## Default answer

Example with the default inputs (Start time 09:00, End time 17:30): From 9:00 AM to 5:30 PM is 8.5 hours (510 minutes).

## Inputs

| Key | Label | Description |
| --- | --- | --- |
| start | Start time | The time the period starts. |
| end | End time | The time the period ends. A time earlier than the start is on the next day. |

## Outputs

| Key | Label | Description |
| --- | --- | --- |
| hours | Hours | The time between the start and the end in decimal hours: minutes ÷ 60. |
| time | Hours and minutes | The time between the start and the end in whole hours and minutes. |
| minutes | Minutes | The time between the start and the end in minutes. |
| nextDay | Ends the next day | Yes when the end time is earlier than the start time, so the period runs past midnight. |

## Method

minutes = end − start in minutes, plus 24 × 60 when the end is earlier than the start; hours = minutes ÷ 60.

## Assumptions

- Times are on a 24-hour clock with no date. An end time earlier than the start time is on the next day, so the answer is always under 24 hours.
- The same start and end time gives 0 hours.
- Clock changes for daylight saving time are not counted: every hour is 60 minutes.

## Worked examples

1. start = 09:00, end = 17:30 gives hours = 8.5, time = {"hours":8,"minutes":30}, minutes = 510, nextDay = no. Source: hand calculation in content.mdx: 17:30 − 9:00 = 8 h 30 min = 510 ÷ 60 = 8.5 hours.
2. start = 22:00, end = 06:15 gives hours = 8.25, time = {"hours":8,"minutes":15}, minutes = 495, nextDay = yes. Source: hand calculation in content.mdx: 6:15 + 24:00 − 22:00 = 8 h 15 min.
3. start = 08:40, end = 12:05 gives hours = 3.416667, time = {"hours":3,"minutes":25}, minutes = 205. Source: hand calculation in content.mdx: 12:05 − 8:40 = 3 h 25 min = 205 ÷ 60 = 3.4167 hours.
4. start = 13:45, end = 13:45 gives hours = 0, minutes = 0, nextDay = no. Source: hand calculation in content.mdx: the same time is 0 hours.

## FAQ

### How do I calculate the hours between two times?

Subtract the start time from the end time. From 9:00 AM to 5:30 PM is 17:30 − 9:00 = 8 hours 30 minutes. To get decimal hours, divide the minutes by 60: 30 ÷ 60 = 0.5, so 8.5 hours.

### How do I count hours past midnight?

Add 24 hours to the end time when it is earlier than the start. From 10:00 PM to 6:15 AM is 6:15 + 24:00 − 22:00 = 8 hours 15 minutes, or 8.25 hours. The calculator does this for you.

### How do I turn minutes into decimal hours?

Divide the minutes by 60. 15 minutes is 0.25 hours, 20 minutes is 0.33, 30 minutes is 0.5, and 45 minutes is 0.75. So 3 hours 25 minutes is 3 + 25 ÷ 60 = 3.42 hours.

### What about a span longer than 24 hours?

Times without dates cannot show more than 24 hours. Use the time duration calculator, which takes a date with each time.

### Does daylight saving time change the answer?

No. The calculator counts clock time: every hour is 60 minutes and there is no time zone. A night shift during the spring or fall clock change is really one hour shorter or longer than the clock times show.

### What if the start and end times are the same?

The answer is 0 hours. For a full 24-hour shift, use the time duration calculator with the two dates.

## Sources

- NIST Special Publication 811 (2008), Guide for the Use of the International System of Units: 1 h = 60 min = 3,600 s. https://www.nist.gov/pml/special-publication-811
