EVERYDAY MATH

Date Calculator

Calculate the difference between two dates or add/subtract days from a date. Get results in days, weeks, months, years, and business days.

Total Days
0
days between the two dates
Weeks + Days
0w 0d
Y / M / D
0y 0m 0d

Breakdown

Total hours0
Total minutes0
Total seconds0
Business days (approx)0

The Surprising Complexity of Counting Days

Leap Years: The 400-Year Cycle

A year is not exactly 365 days — it is 365.2422 days. The Gregorian calendar compensates with a rule: add a leap day every 4 years, except every 100 years, except every 400 years (which isa leap year). So 1900 was not a leap year, but 2000 was. This gives an average year length of 365.2425 days, accurate to within 26 seconds per year. The drift accumulates to one day every 3,236 years — good enough that no correction has been needed since the calendar was introduced in 1582.

Business Days vs. Calendar Days

A “30-day” notice period contains approximately 22 business days (excluding weekends). Legal and financial contexts often specify which count applies. In the US, the SEC requires companies to file annual reports within 60 calendar days of fiscal year end. Shipping estimates use business days. Credit card billing cycles use calendar days. Our calculator provides both counts. For precise business day calculations, you would also need to account for public holidays, which vary by country and sometimes by state or region.

The “Month” Problem in Software

“Add one month to January 31” has no obvious answer — February 31 does not exist. Different systems handle this differently: JavaScript's Date rolls over to March 3 (28+3), while many business systems cap at the last day of the month (February 28/29). “One month from March 31” could be April 30 (last day) or May 1 (31 days later). Subscription billing, contract law, and insurance calculations all face this ambiguity. The ISO 8601 standard recommends using specific day counts rather than “months” for precision-critical applications.

Unix Epoch and the 2038 Problem

Computers measure time as seconds since January 1, 1970, 00:00:00 UTC (the Unix epoch). A 32-bit signed integer can store up to 2,147,483,647 seconds — which overflows on January 19, 2038 at 03:14:07 UTC. After that moment, 32-bit systems will wrap to a negative number, interpreting the date as December 13, 1901. This is the “Y2K38 problem.” Modern 64-bit systems use a 64-bit timestamp that won't overflow for 292 billion years. The migration is ongoing in embedded systems, IoT devices, and legacy databases.

Frequently Asked Questions

How are months calculated when they have different lengths?

Our calculator uses calendar month boundaries: the difference between Jan 15 and Mar 15 is exactly 2 months (regardless of February's length). The remaining days are calculated from the last full month boundary. From Jan 31 to Mar 15 is 1 month and 15 days (Jan 31 to Feb 28/29 is 1 month, then Feb 28/29 to Mar 15 is 15 days). This matches how most legal and financial systems count months.

Does “30 days” always equal “one month”?

No. Calendar months range from 28 to 31 days. “30 days from January 1” is January 31, but “one month from January 1” is February 1. In banking, a “30/360” day-count convention assumes every month has 30 days and every year has 360 days, simplifying interest calculations. Credit card companies typically use actual calendar days for their billing cycles.

What is an ISO week, and when does week 1 start?

ISO 8601 defines week 1 as the week containing the first Thursday of the year (equivalently, the week containing January 4). Weeks start on Monday. This means January 1 can fall in week 52 or 53 of the previous year. For example, January 1, 2023 was a Sunday and belonged to ISO week 52 of 2022. A year has either 52 or 53 ISO weeks. This system is widely used in European business planning and project management.