企评社

Interface labels are shown in English. Company reviews, forum posts and tool descriptions are currently available in Chinese only.

Date calculator

Date difference, date arithmetic, age and countdown in one page; computed as you type, entirely in your browser, nothing uploaded.

所有计算都在你的浏览器里完成,不上传

两个日期相差多少

日期计算最常见的几种场景

算工龄、租期、项目周期、孕周、还款日。日常里要数天数的场合,几乎都能归成三类:① 知道首尾两天,问「一共多少天」——入职到离职、起租到退租、合同签订到到期;② 知道开始日与一段时长,问「到哪天」——今天起 90 天后的还款日、签约日加 24 个月后的到期日;③ 知道出生日期或起始日期,问「现在多少岁 / 过去了多久」。本页把这三类做成了四个模式,输入即算,不需要点「计算」按钮,改一个数字结果就跟着变。

「含首尾」和「不含首日」为什么差一天。同一个区间,天数有两种同样常见的数法:含首尾是把开始日和结束日都算进去(1 日到 3 日 = 3 天,这是请假、住院、工期最常见的口径);不含首日只算「从开始日之后到结束日」,也就是把开始日当作第 0 天(1 日到 3 日 = 2 天,这是「过了几天」「间隔几天」的口径)。两者永远刚好差 1 天,本页两个数都给出,你按自己场景挑——写进合同或表格前,务必和对方确认是哪一个口径,这是日期纠纷里最常见的一处误会。

工作日为什么不是「天数减去周末」。本页的工作日只排除周六与周日,用整周 5 天加零头的方式精确计数,所以哪怕区间里跨月、跨年、跨闰年也不会数错。但要特别注意:它不包含法定节假日,也不计算调休上班。中国每年的放假安排由国务院办公厅单独发布,元旦、春节、清明、劳动节、端午、中秋、国庆的具体日期与调休补班日年年不同,有的年份还会有临时调整。任何不在线更新这张表的工具,只要硬编码节假日就一定会过期;与其猜错,不如明确告诉你「这里只扣周末」。所以涉及法定假日的工期、账期,请在本页结果上再手工扣掉这几天(或去查当年的放假通知)——「还剩 10 个工作日」在本页的准确含义是「还剩 10 个周一至周五」。

月份加减的「月末溢出」是怎么处理的。日期加减天、周永远不会有歧义,但加减「月」和「年」会碰到一个绕不开的问题:1 月 31 日加 1 个月是 2 月几日?2 月根本没有 31 日。常见的处理有三种——夹到当月最后一天(2 月 28/29 日)、往后溢出到下个月(3 月 2/3 日)、或直接报错。本页统一采用夹到当月最后一天,这也是 Excel 的 EDATE 函数、多数银行账期与合同期限计算采用的规则:3 月 31 日减 1 个月 = 2 月 28/29 日,8 月 31 日加 1 个月 = 9 月 30 日,闰年 2 月 29 日加 1 年 = 次年 2 月 28 日。它有一个必然的副作用:29/30/31 日出生的人,生日前的那个月按此规则会落到 28 日附近,看起来「少了一天」;这不是算错,而是规则本身如此。你如果用的是别的口径(例如到期日顺延到 3 月 1 日),请在本页结果上手工调整一天。

年龄:周岁与虚岁为什么差一岁。周岁(法律、证件、入学、退休都用它)按「过生日才长一岁」计算,生日当天即长一岁,生日前一天都还差一天。虚岁在民间是另一套算法,且各地各家用得并不统一;本页给的是最常见的简式口径:出生即 1 岁,此后每跨一次公历新年加 1 岁(所以年末出生的人在春节前后就已「2 岁」)。民俗里更讲究的算法以农历新年(春节)为分界,个别地区还有以立春为界的说法,因此本页的虚岁可能与长辈的说法差 1 岁——它只适合用来理解说法差异,不适合填表。生肖同理,本页按公历年给出,若以立春或春节为界会有不同结果,页面已标注,请勿当作唯一答案。

为什么不上传到服务器。日期计算不需要任何后端能力,本页的核心计算全部是一段纯 JavaScript 函数,在你打开的这个页面里执行,输入框里的内容不会离开你的设备(打开浏览器开发者工具的 Network 面板可以看到整页没有任何提交请求)。这也是本页唯一会「记住」东西的地方:倒数日模式把目标日期与事件名写进网址的 # 片段,方便你收藏或分享,而 # 之后的内容浏览器不会发送给服务器,页面本身也不读取你的姓名、手机号或任何其它信息。

FAQ

Why do 'including both ends' and 'excluding the first day' always differ by 1? Which should I use?

They differ only by the start day: inclusive = end - start + 1; exclusive of the first day = end - start. Use the inclusive count for 'how many days does it occupy' - leave from the 1st to the 3rd, a 3-day hospital stay, a 3-day work window; use the exclusive count for 'how many days apart / how many days passed / how far from today'. This page shows both numbers side by side with the rule written next to each, so you cannot copy the wrong one.

Why does January 31 plus one month become February 28, not March 2 or 3?

Because this page - like Excel's EDATE and most banking and contract practice - clamps to the last day of the target month: if the target month has no 31st, take the latest day it can offer. That is the 28th in common years and the 29th in leap years; likewise March 31 minus one month is February 28/29, August 31 plus one month is September 30, and February 29 of a leap year plus one year is February 28 of the next. If your rule is 'due dates always roll to the 1st of the next month' or 'pull back to month end', adjust one day manually on top of this result - this page will not switch conventions for you.

Why don't workdays exclude public holidays and swapped rest days?

Because the holiday schedule is published separately every year and gets adjusted on short notice; a local tool cannot guarantee it stays right, and shipping a stale table is more dangerous than none at all. Workdays here are strictly 'Mondays through Fridays inside the range', counted exactly with whole-weeks-plus-remainder arithmetic, immune to month and year boundaries. For an exact schedule, subtract the statutory holidays and add back make-up workdays on top of this page's number.

How exactly is 'nominal age' computed? Why does it differ from what elders say?

This page uses the simple convention for nominal age: you are 1 at birth and gain 1 every time the Gregorian New Year (January 1) is crossed. Folk practice more commonly switches at the Lunar New Year, and some count from Start of Spring - which is why people born late in the year hear a number 1 apart from elders around Spring Festival. The counting-age you grow on your birthday is the convention used for documents, school enrollment and retirement, and this page gives it as the primary result.

What does the countdown link save? Can I share it?

Only the target date and the event name, written after the # in the URL, like #d=2026-06-07&t=exam. The # fragment is never sent to the server by the browser, and the page reads no other information. Send the whole link to someone and they will see the same countdown; leave the event name empty and the link carries only the date.

What happens if I enter a date that does not exist, like 2026-02-30?

The page says 'this date does not exist' right under the input and stops updating the results - it does not silently treat it as March 2 and keep going. The date picker normally will not let you pick an impossible day either; type it or script it in, and the same validation stops it. All dates are built and compared in local time (your device's timezone) with no UTC round-trip, so there is no off-by-one-day surprise.

Related tools