日期差计算
计算两个日期之间的时间。
计算时间间隔,支持跨午夜。
详细方法和示例目前以英语提供。
Convert each time to seconds after midnight and subtract. Without explicit dates, an earlier end time adds 24 hours. With dates, add the elapsed calendar days and reject a negative overall duration. Decimal hours equal seconds divided by 3,600.
From 22:30 to 01:15 without dates, the overnight duration is 2 hours and 45 minutes, or 2.75 decimal hours.
Check the length of a session, an overnight shift, or a recorded activity. Decimal hours help when a downstream worksheet expects a single number rather than an hours-and-minutes duration.
It is treated as occurring on the following day. For example, 22:30 to 01:15 gives 2 hours 45 minutes. Supply dates for longer intervals.
No. It measures the entered interval. Subtract unpaid breaks separately if you are using the output for a timesheet.