PlayTools

日期间隔:项目排期、假期与按比例结算

精确计算两个日期之间的天数、周数和月数,自动处理闰年。

Runs in your browser — nothing you enter is uploaded

Time Until

1,056 days

2 years, 10 months, 21 days

Days

1,056

Weeks

150

+6 days

Months

34

Common date spans

Worked-out pages for frequently searched date ranges, each with a week and month breakdown.

日期间隔:项目排期、假期与按比例结算

计算两日期间隔常用于项目缓冲、按比例退费、租期天数与假期核算。闰年与大小月规则与主流日期库一致。

若合同写「五个工作日」,需另行剔除节假日,本工具按自然日计算。

跨时区截点可搭配时区工具;周期性任务可看 cron 生成器。

法定截止日以司法机关或合同解释为准,结果仅供参考。

How the difference is counted

The headline figure is the number of calendar days from the start date to the end date: the start date is not counted and the end date is — the same result as subtracting one date from the other, or counting nights in a hotel. Monday to Friday is 4 days. If you need to count both the first and last day, add 1.

Below it, the same span is broken down into whole years, months and days, counted the way a calendar works rather than by dividing by 30: 1 January to 25 December 2026 is 11 months and 24 days, or 358 days. When the start day does not exist in a shorter month, the month counts as complete on its last day, so 31 January to 28 February is exactly one month.

Dates are read in your own time zone, and daylight-saving changes never add or remove a day. If the end date is before the start date, the tool shows how long ago it was instead.

Worked examples

  • Leap years: 1 February to 1 March 2024 is 29 days; the same dates in 2026 are 28 days apart.
  • Deadlines: 90 days after 2 October 2026 is 31 December 2026. Check whether your contract counts the day of notice itself — some legal deadlines do.
  • Weeks: 358 days is 51 weeks and 1 day, shown as the weeks figure plus remaining days.
  • Project buffers: if a release is due on 15 March and today is 1 February, there are 42 days left, or 6 weeks.

Calendar days, business days and deadlines

This tool counts calendar days. Many contracts, shipping estimates and government processes use business (working) days instead, which skip weekends and public holidays — use the business days calculator for those. Also check how a deadline is phrased: “within 30 days of” usually starts counting the day after the event, while “by day 30” can include it. When money or legal rights depend on the answer, confirm the rule with the other party or an adviser.

Calendar facts behind the numbers

  • Leap years: a year is a leap year if it is divisible by 4, except century years, which must be divisible by 400 — 2000 was a leap year, 2100 will not be.
  • A common year has 365 days (52 weeks and 1 day); a leap year has 366.
  • Month lengths repeat on a pattern: 31 days in January, March, May, July, August, October and December; 30 in April, June, September and November; February has 28 or 29.
  • For hours, multiply days by 24 — 358 days is 8,592 hours — but local clocks gain or lose an hour on daylight-saving days.

These free tools pair well with this page — open them in a new tab to finish your workflow.

常见问题

日期差是如何计算的?

工具将较晚的日期减去较早的日期。先计算日历天数,然后转换为周、月和年。基于日历的月数计算考虑了月份长度的不同(28-31天)。

计算是否包含起始和结束日期?

计数不含开始日、含结束日——相当于两个日期相减,或按“晚数”计算:周一到周五为 4 天。如需同时计入首尾两天(例如周一到周五的五天活动),在结果上加 1。

闰年是如何处理的?

闰年被完整考虑。当计算跨越2月29日时,那额外的一天会包含在总天数中。

为什么月数计算有时看起来不准确?

月份长度不同,因此基于月份的计算可能看起来不一致。例如,1月31日到3月31日是2个月,但1月31日到2月28日是1个月。工具使用日历月算术,而非固定的30天定义。

我可以只计算工作日吗?

此工具计算日历天数。工作日计算需要知道哪些天是周末,还要考虑各国不同的公众假期。对于工作日计算,您需要支持区域设置的专用工具。

什么是儒略日数?

儒略日数(JDN)是从儒略历元(公元前4713年1月1日)开始的连续天数计数。它在天文学和日期计算软件中常用,因为它消除了月份和年份的复杂性。

我可以用它计算年龄吗?

可以——只需将出生日期作为开始日期,今天作为结束日期。结果会以天、月和年显示您的年龄。若需专门的年龄显示,请使用年龄计算器工具。