跳到正文

STEMSTUDIO

Count days between dates

Calculator · runs on this device

Count days between dates

Days, weeks, months and business days between two dates — or the date N days away.

  • Free, no account
  • Nothing is sent

Help

Saturdays and Sundays excluded; public holidays are not. Both end dates are counted. When shifting by months, a target month without that day clamps to its last day (31 March plus one month is 30 April). Saturdays and Sundays are skipped; public holidays are not. The starting date itself is not counted — five business days after a Friday is the following Friday.

Processing, communication and stored data

一次得到两个日期之间相隔的天数、周数、月数和工作日,或者按天、周、月、工作日推算日期。输入的日期不会离开浏览器。

常见问题

能处理闰年吗?

能。跨过 2 月 29 日的间隔会正确计算。能被四整除的年份是闰年,但不能被四百整除的整百年除外——2000 年是闰年,2100 年不是——这里用的就是这条规则。

能用过去的日期吗?

能。如果结束日期早于开始日期,两者会自动交换并提示。推算模式选“之前”就往回移。日期栏是浏览器自带的日期选择器,任何四位数的年份都可以。

能用来算年龄吗?

作为近似可以:把出生日期放在开始栏、今天放在结束栏,把月数除以十二。不过各国对年龄的法律定义不同,需要正式数字的场合不要用这个。

考虑时间或时区吗?

不考虑。只处理完整的日期,全部按 UTC 午夜计算,所以无法给出以小时和分钟计的间隔。好处是夏令时切换永远不会让天数差一天。

能排除法定节假日吗?

不能——只排除周末。节假日各国不同、每年变动,没有准确的节假日表却标成工作日会误导人。请从显示的数字中减去落在间隔内的节假日。

Ratings from users

Ratings appear once there are 10.

Report a problem or suggest something

The tool name, this page’s path and your browser type are sent with it. Files are never sent. For a reply, use the email on the Contact page.