小时计算器 — 计算两个时间之间的小时数
本小时计算器计算起始时间和结束时间之间的总小时数和分钟数。输入 24 小时制时间,可选添加休息时间,即时显示 HH:MM 格式、小数小时和总分钟数——非常适合考勤表、工资核算和排班管理。系统自动检测跨午夜班次。
Result
常见问题
工时计算器是如何工作的?
工时计算器通过计算开始时间和结束时间之间的差值来得出工作小时数,并自动减去休息时间。支持跨午夜计算(如夜班),并可将结果转换为十进制小时或小时分钟格式。
如何计算含休息时间的工时?
输入上班时间、下班时间和休息时长(如 30 分钟午休),计算器会自动从总时长中减去休息时间。如需计算多个班次,可分别计算后求和。
如何计算加班工资?
加班工资通常按标准时薪的 1.5 倍计算(具体依据当地劳动法规)。本计算器可输入标准工时(如每天 8 小时),超出部分自动按加班工资率计算总工资。
小时数的十进制格式是什么?
十进制格式将分钟转换为小时的小数部分。例如,7 小时 30 分钟 = 7.5 小时(30 分钟 = 0.5 小时),这便于乘以时薪计算工资。本计算器同时显示时:分格式和十进制格式。
Hours Calculation Formula
Calculating hours between two times uses a simple subtraction of start time from end time, expressed in minutes, with an optional break deduction.
Step 1 — Convert times to minutes
Start (minutes) = startHour × 60 + startMinute
End (minutes) = endHour × 60 + endMinute
Step 2 — Subtract
Total Minutes = End − Start − Break Minutes
Step 3 — Convert back to hours and minutes
Hours = ⌊Total Minutes / 60⌋
Minutes = Total Minutes mod 60
Decimal Hours = Total Minutes / 60
How to Calculate Hours Between Two Times
Enter the start and end times using 24-hour format (0–23 for the hour, 0–59 for the minute). Optionally enter the break duration in minutes to have it automatically deducted from the total.
Example: Standard work day
- Start: 9:00 (9 AM)
- End: 17:00 (5 PM)
- Break: 60 minutes
- Result: 07:00 — 7 hours worked
Example: Part-time shift
- Start: 14:30
- End: 19:15
- Break: 0 minutes
- Result: 04:45 — 4 hours 45 minutes
Cross-Midnight Calculation
When the end time is earlier than the start time, the calculator automatically assumes the shift crosses midnight and adds 24 hours to the end time before subtracting.
Example: Night shift from 22:00 to 06:00
End = 06:00 < Start = 22:00 → add 24 hours to End
Adjusted End = 06:00 + 24:00 = 30:00
Duration = 30:00 − 22:00 = 08:00
Decimal Hours Conversion
Decimal hours are useful for payroll calculations, billing, and spreadsheets. Instead of expressing time as hours and minutes, a single decimal number represents the same duration.
Decimal Hours = Total Minutes / 60
Example: 7 hours 30 minutes = 450 minutes → 7.5 decimal hours
Example: 8 hours 15 minutes = 495 minutes → 8.25 decimal hours
Common Work Hour Examples
Reference table for common shifts and their decimal equivalents:
| Start | End | Break | Duration | Decimal Hours |
|---|---|---|---|---|
| 09:00 | 17:00 | 0 min | 08:00 | 8.00 |
| 09:00 | 17:00 | 30 min | 07:30 | 7.50 |
| 09:00 | 17:00 | 60 min | 07:00 | 7.00 |
| 08:00 | 16:30 | 30 min | 08:00 | 8.00 |
| 06:00 | 14:00 | 0 min | 08:00 | 8.00 |
| 14:00 | 22:00 | 30 min | 07:30 | 7.50 |
| 22:00 | 06:00 | 0 min | 08:00 | 8.00 |
| 07:30 | 12:00 | 0 min | 04:30 | 4.50 |
Related Tools
- Time Calculator — Add and subtract multiple time durations in HH:MM:SS format
- Overtime Pay Calculator — Calculate regular and overtime pay based on hours worked
- Date Calculator — Find the difference between two dates or add days to a date