免费 · 日期与时间
两个日期相差天数计算.
计算两个日期之间相差的年、月、日、周、工作日和小时数,或在日期上加减天、周、月或年。
Gregorian calendar, years 0001–9999. Adding months keeps the day number when possible (31 January + 1 month = 28 or 29 February).
如何计算两个日期之间的天数
- 选择
Time between two dates(两个日期之间的时间)。 - 输入开始日期和结束日期。顺序不限:如果结束日期更早,结果会显示为负数。
- 如果第一天和最后一天都要计算在内(例如休假、酒店住宿或活动),请勾选
Include the end date(包含结束日期)。 - 查看以年、月、日表示的时长,以及总天数、周数和工作日(周一至周五)。
示例:从 2026 年 3 月 1 日到 2026 年 3 月 31 日,结果为 30 天;包含结束日期时为 31 天,因为 3 月 31 日本身也被计算在内。
是否包含结束日期?
默认情况下,计算器测量的是经过的时间,就像在电子表格中用一个日期减去另一个日期:不计算结束日期。当您统计一个时间段从开始到结束的日历天数时(例如假期天数,或在最后一天到期的合同),请包含结束日期。
月份按照真实日历计算,而不是按 30 天的平均值。1 月 31 日加一个月得到 2 月的最后一天(2024 年为 2 月 29 日),因此跨越小月的时长依然准确。
限制与支持格式
输入内容在您的设备上处理。
英语技术说明
Gregorian calendar, years 0001–9999. Working days count Monday to Friday without public holidays (use the Business Days Calculator to add holidays).
Date difference and date arithmetic with calendar-correct month handling, total days, weeks, working days, months, decimal years, hours, minutes and seconds, ISO week number and a shareable link.
31 January 2024 to 15 March 2026 = 2 years, 1 month, 15 days (774 days); 31 January 2024 + 1 month = 29 February 2024.
常见问题
会计算结束日期吗?
默认不会。勾选“Include the end date”即可多算一天,统计假期或租期天数时通常需要这样做。
为什么 1 月 31 日加一个月是 2 月 29 日?
2 月没有 31 日,因此计算器取该月的最后一天。在非闰年,结果是 2 月 28 日。
工作日会扣除节假日吗?
不会。这里的工作日是周一至周五。请使用工作日计算器输入您自己的节假日。
可以计算很久以前或很久以后的日期吗?
可以,支持公历 0001 年至 9999 年之间的任意日期。