计算工具/日期计算器
日期计算器
日期差计算和倒计时
输入
结果
请选择日期
Date Calculator Guide
Learn how to calculate date differences and add/subtract dates
What is Date Calculator?
The Date Calculator helps you find the difference between two dates or add/subtract time from a date. Perfect for calculating age, project deadlines, event planning, D-day countdowns, and pregnancy due dates.
How to Use
- Choose a mode: Date Difference or Add/Subtract
- For difference: Select start and end dates
- For add/subtract: Enter base date and time to add/subtract
- View results in years, months, weeks, days, and hours
Practical Tips
- Use Date Difference to calculate exact age or days until an event
- Add/Subtract mode is perfect for calculating due dates
- Results show both total days and broken-down format
Accuracy & Limitations
Date calculations account for leap years and varying month lengths. All calculations are performed locally in your browser. Note that results assume the Gregorian calendar system.
常见问题
闰年是如何计算的?
闰年规则:1) 能被4整除则是闰年,2) 能被100整除则不是闰年,3) 能被400整除则是闰年。例如:2024年(闰年)、1900年(平年)、2000年(闰年)。本工具自动考虑闰年。
可以只计算两个日期之间的工作日吗?
目前此工具计算所有天数(包括周末)。如需工作日计算,可以从总天数中减去周末数。大致可用总天数 × 5/7(按每周5个工作日)来估算。
日期差计算中是否包含开始日和结束日?
通常差值计算是结束日减去开始日,所以不包含开始日。例如:1月1日到1月3日 = 2天。如果要包含两个日期,请在结果上加1。
支持农历转换吗?
目前只支持公历(格里高利历)。农历转换需要复杂的天文学计算。如需农历日期,请使用专用的公历农历转换器。
可以计算很久以前的日期吗?
JavaScript Date对象支持1970年前后约±270,000年的范围。但由于格里高利历于1582年引入,之前的日期在历史上可能不准确。