日期计算器
本日期计算器计算任意两个日期之间的精确天数、周数、月数和年数。您也可以在特定日期上加减天数以求得未来或过去的日期,并可选择仅计算工作日。
常见问题
两个日期之间有多少天?
要计算两个日期之间的天数,用较晚的日期减去较早的日期。我们的计算器会自动处理,包括闰年和各月天数变化。例如,非闰年的 1 月 1 日到 3 月 1 日为 59 天,闰年则为 60 天。
如何计算两个日期之间的天数?
计算两个日期之间的天数,用较晚的日期减去较早的日期。将两个日期转换为公共参考点(如儒略日数或 Unix 时间戳),然后求差值。例如,非闰年从 1 月 1 日到 3 月 15 日:1 月 31 天 + 2 月 28 天 + 3 月 15 天 = 74 天。我们的计算器自动处理各月天数变化、闰年和历法规则的复杂性。
如何给日期增加天数?
给日期增加天数,从给定日期开始向前数指定天数,考虑各月天数变化和闰年。例如,在 1 月 20 日增加 45 天:数完 1 月剩余的 11 天(到 1 月 31 日)、2 月全部 28 天(非闰年),再加 6 天进入 3 月,得到 3 月 6 日。我们的计算器可以即时处理任意天数。
一年有多少个工作日?
标准年份有 260 个工作日(52 周 × 5 个工作日),减去公共假日。在美国,有 11 个联邦假日,每年通常有 249 个工作日。如果额外的一天落在工作日,闰年可能会多一个工作日。
从今天起 30 天是哪天?
使用日期计算器的「日期加减」选项卡。选择今天的日期,在天数字段输入 30,计算器即时显示结果日期和星期几。
如何手动计算两个日期之间的差值?
统计起始月份剩余天数,加上中间每个月的完整天数,再加上最后一个月的天数。或者将两个日期转换为年内第几天的数字并相减。对于跨年的日期,每完整年加 365(闰年加 366)。
什么是闰年,它如何影响日期计算?
闰年有 366 天而非 365 天,2 月有 29 天而非 28 天。能被 4 整除的年份是闰年,但能被 100 整除的世纪年必须同时能被 400 整除才是闰年。所以 2024 年是闰年,1900 年不是,2000 年是。日期计算必须考虑这一点,以避免一天的误差。
一年有多少天?
普通年份有 365 天,闰年有 366 天。能被 4 整除的年份是闰年(能被 100 整除的年份例外),除非也能被 400 整除。所以 2024 年是闰年,1900 年不是,但 2000 年是。公历年的平均长度为 365.2425 天。这对于跨越多年的精确日期计算非常重要。
如何计算两个日期之间的工作日?
计算工作日(平日),先算出两个日期之间的总天数,再减去周末。每完整一周有 5 个工作日。逐一统计不完整周的剩余天数,排除周六和周日。例如,从周一到下周五是 5 个工作日(但如果是同一周则是 5 个日历天,下周则是 12 个日历天)。请注意,除非特别说明,公共假日不会自动排除。
两个日期之间有多少周?
计算两个日期之间的周数,先计算总天数,再除以 7。例如,两个日期之间相差 45 天,等于 6 周零 3 天(6 个完整周加上 3 天余数)。如果只需完整周数,向下取整。余数表示额外天数。我们的计算器同时提供精确周数和剩余天数。
What is a Date Calculator?
A date calculator is a versatile tool for performing arithmetic with calendar dates. Our date calculator lets you find the exact number of days between two dates or calculate a future or past date by adding or subtracting a specific number of days. Whether you need to determine project timelines, count down to deadlines, or plan events, the date calculator provides instant, accurate results broken down into days, weeks, months, and years.
How to Calculate Days Between Two Dates
To calculate the number of days between two dates manually, follow these steps:
- Count the remaining days in the start month (total days in that month minus the start day)
- Add the total number of days for each complete month between the start and end months
- Add the day of the end date
Example: Days from March 15 to June 10. Remaining days in March: 31 - 15 = 16. Full months: April (30) + May (31) = 61. Days in June: 10. Total: 16 + 61 + 10 = 87 days.
For dates spanning different years, add 365 days for each common year and 366 for each leap year between them. Our Date Calculator handles all of this automatically, including edge cases like leap years and month-end boundaries.
How to Use the Date Calculator
Calculate Days Between Two Dates
- Select the "Days Between" tab
- Enter a start date using the date picker
- Enter an end date using the date picker
- View the result instantly as total days, weeks and days, months and days, or years, months, and days
Add or Subtract Days from a Date
- Select the "Add/Subtract Days" tab
- Choose a starting date
- Enter the number of days to add or subtract
- Toggle between "Add" and "Subtract" mode
- The resulting date is displayed immediately
Common Date Calculations
Here are some frequently needed date calculations for quick reference:
| Scenario | Days |
|---|---|
| 30 days from today | Use Add Days tab |
| 60 days from today | Use Add Days tab |
| 90 days from today | Use Add Days tab |
| 6 months | ~182 days |
| 1 year | 365 or 366 |
Leap Year Rules
Leap years are critical for accurate date calculations. A year is a leap year if it meets these rules:
- Divisible by 4: The year must be evenly divisible by 4 (e.g., 2024, 2028)
- Century exception: If the year is divisible by 100, it is not a leap year (e.g., 1900, 2100)
- 400-year exception: If the year is divisible by 400, it is a leap year despite the century rule (e.g., 2000, 2400)
In a leap year, February has 29 days instead of 28, making the total year 366 days. This means any date calculation that spans February must check whether the year is a leap year to avoid off-by-one errors. Our calculator handles this automatically.
Business Days Explained
Business days (also called working days or weekdays) are Monday through Friday, excluding weekends (Saturday and Sunday). When counting business days between two dates:
- Each complete week contributes exactly 5 business days
- For partial weeks, count only the weekdays (Monday-Friday)
- Public holidays are typically excluded from business day counts but vary by country and region
A standard year has 260 business days (52 weeks x 5 weekdays). After subtracting the 11 US federal holidays, a typical US working year has approximately 249 business days.
US Federal Holidays 2026
The following table lists the 11 US federal holidays for 2026, useful when calculating business days:
| Holiday | 2026 Date | Day |
|---|---|---|
| New Year's Day | Jan 1 | Thursday |
| Martin Luther King Jr. Day | Jan 19 | Monday |
| Presidents' Day | Feb 16 | Monday |
| Memorial Day | May 25 | Monday |
| Juneteenth | Jun 19 | Friday |
| Independence Day | Jul 4 (obs Jul 3) | Saturday |
| Labor Day | Sep 7 | Monday |
| Columbus Day | Oct 12 | Monday |
| Veterans Day | Nov 11 | Wednesday |
| Thanksgiving | Nov 26 | Thursday |
| Christmas | Dec 25 | Friday |
How Days Between Dates is Calculated
The date calculator computes the difference between two dates by converting each date into a timestamp (milliseconds since January 1, 1970) and finding the absolute difference. The result is then converted into calendar units:
- Total Days: The absolute difference in milliseconds divided by the number of milliseconds in a day (86,400,000).
- Weeks + Days: Total days divided by 7, with the remainder as extra days.
- Years, Months, Days: Calendar-aware calculation that accounts for varying month lengths and leap years.
Examples
Days Between January 1 and December 31
From January 1 to December 31 of the same year is 364 days (365 in a leap year). The date calculator breaks this down as 52 weeks and 0 days, or 11 months and 30 days.
Adding 90 Days to a Date
Adding 90 days to March 1, 2025 gives May 30, 2025. This is useful for calculating quarterly deadlines, warranty expiration dates, or trial period end dates.
Common Use Cases
- Project management: Calculate durations and deadlines
- Legal and contractual: Determine notice periods and filing deadlines
- Healthcare: Track treatment cycles and follow-up appointments
- Education: Count school days and semester lengths
- Personal: Plan vacations, count days until events, or track milestones
- Finance: Calculate interest accrual periods and payment schedules
Related Tools
- Countdown Calculator— Count down to a specific date or event
- Age Calculator— Calculate exact age in years, months, and days
- Half Birthday Calculator— Find the date exactly halfway between birthdays
Tips for Using the Date Calculator
- The order of start and end dates does not matter — the calculator always returns a positive difference
- Use the "Add/Subtract" tab to quickly find future or past dates relative to today
- Copy results to your clipboard with a single click for easy sharing
- The "Years + Months + Days" breakdown accounts for calendar-specific month lengths, providing the most human-readable result