📅 Date Difference Calculator

Compute calendar and workday differences between two dates.

📐 计算公式
自然日 = |结束日期 − 起始日期| 毫秒差 ÷ 86400000 四舍五入;工作日 = 区间内逐日累加并剔除周六日;周数 = 自然日÷7,月数 = 自然日÷30.4375,年数 = 自然日÷365.25,小时数 = 自然日×24。校验:起止日期均须为有效 YYYY-MM-DD,解析失败标红并提示;判据:起始晚于结束时按倒序区间识别,天数取绝对差。
输入起止日期,计算自然日天数、工作日天数(排除周末)、相隔周数与月数。
💡 工作日按公历计算,排除周六、周日;自然日为两个日期间的总天数(含首不含尾或含尾不含首,本工具按"结束日-开始日"取绝对值)。

Formula & Standard References

Item Formula / Note Source / Standard
Date differenceD = end − start in calendar daysISO 8601
Working daysWeekends onlyLabour calculation
Julian day numberJDN conversion for cross-calendarAstronomical algorithms
Leap year ruleDivisible by 4 not 100, or by 400Gregorian calendar
Timezone effectNormalise to UTCISO 8601 §4
ISO weekWeeks start Monday, Thursday ruleISO 8601 §4.3
⚠️ 使用说明与注意事项
  • 开始日期需早于或等于结束日期,否则自动取绝对值
  • 工作日仅排除周末,不考虑法定节假日调休
  • 按 Enter 快速计算,Ctrl/Cmd + Enter 复制结果
  • 本工具纯前端运行,数据不会上传到服务器

🕘 最近计算

暂无计算记录