AbraCalc

Days Between Dates

Count the number of days between two dates.

Embed this tool on your site
Cite this tool

APA

AbraCalc. (2026). Days Between Dates [Online calculator]. Retrieved from https://abracalc.com/calculator/days-between-dates/

BibTeX

@misc{abracalc-days-between-dates, author = {AbraCalc}, title = {Days Between Dates}, year = {2026}, howpublished = {\url{https://abracalc.com/calculator/days-between-dates/}} }

Did this tool answer your question?

How to use this tool

  1. Enter start date and end date in the fields above.
  2. Results update instantly as you type — or click Calculate.
  3. Read your days and the full breakdown beneath it.

Count the number of days between two dates.

Formula

Days = round((End Date − Start Date) ÷ 86,400,000)

where both dates are converted to milliseconds since the Unix epoch and the divisor converts milliseconds to days.

How it works

This calculator finds the number of calendar days between two dates by subtracting the start date's Unix timestamp (in milliseconds) from the end date's timestamp and dividing by the number of milliseconds in one day (86,400,000).

Rounding handles Daylight Saving Time transitions that cause some days to be 23 or 25 hours long; the result always represents whole calendar days. The count is exclusive of the start date and inclusive of the end date, meaning January 1 to January 31 yields 30 days, not 31.

Worked example

  1. Start date = 2024-01-01; end date = 2024-01-31.
  2. Milliseconds for 2024-01-01 (UTC): 1,704,067,200,000 ms.
  3. Milliseconds for 2024-01-31 (UTC): 1,706,659,200,000 ms.
  4. Difference = 2,592,000,000 ms ÷ 86,400,000 = 30.

Days between dates = 30.

Common mistakes to avoid

  • Confusing inclusive vs. exclusive counting -- the formula gives elapsed days, not the count of calendar days including both endpoints.
  • Mixing up date order and getting a negative result; swap start and end to fix it.
  • Ignoring daylight-saving transitions when crossing spring-forward or fall-back boundaries, which can shift the result by 1 day.

Key terms

Unix epoch
The reference point for Unix timestamps: midnight on 1 January 1970 (UTC). All dates are stored as milliseconds elapsed since this moment.
Calendar day
A period from midnight to midnight, counted as one unit regardless of whether a DST change occurs within it.
Daylight Saving Time (DST)
A seasonal clock adjustment that makes some days 23 or 25 hours long; rounding compensates for this when counting days.
Inclusive vs exclusive count
Whether the start and end dates themselves are counted. This tool counts the gap (exclusive of start, inclusive of end), so a span within the same month of 31 days yields 30.
ISO 8601
The international date format YYYY-MM-DD, used by this calculator to ensure unambiguous date parsing.

Frequently asked questions

Does the calculator count both the start and end date?
No. The formula measures elapsed days from midnight to midnight. If you need to count both endpoints (e.g., for a rental), add 1 to the result.
How do I count business days instead of calendar days?
Subtract the number of weekends and public holidays in the range. As a rough estimate, multiply calendar days by 5/7 to get approximate weekdays.
Can I calculate days between dates across different years?
Yes. The formula converts both dates to milliseconds since the Unix epoch, so it handles leap years and year boundaries automatically.

References & sources