Epoch day

Epoch day: A whole-number count of days since January 1, 1970. Date calculators use it internally, so date arithmetic reduces to integer subtraction.

The count starts at zero on January 1, 1970. January 2, 1970 is day 1. January 1, 2000 is day 10,957, which is 30 years of 365 days plus 7 leap days.

January 1, 2024 is day 19,723. To find the number of days between two dates, subtract their epoch days: 19,723 − 10,957 = 8,766. Add 8,766 days to the year 2000 start and you land at the start of 2024.

Software stores dates this way because subtraction is trivial, sorting works and leap years take care of themselves once the count is built; the friendly date you see on screen is a formatted view of that one whole number.

Epoch day: interpretation pitfalls

Off-by-one errors in day counts, almost always from a timezone boundary instead of the arithmetic. Same-day comparisons across zones are where it shows up first.

Epoch day: comparisons with other measurements

An epoch day is not the same as a Unix timestamp, though the two are closely linked; a Unix timestamp counts seconds since the same starting moment, so epoch day equals the timestamp divided by 86,400, rounded down. It also differs from a Julian day number, which counts days from a much older reference point, and from day of year, which resets each January. Time zones matter for timestamps, since the same second is a different date in different places.

An epoch-day count avoids that by counting calendar dates.

Epoch day: limits of the definition

Different systems choose different starting points. Spreadsheets use dates such as 1900 or 1904, and other software uses other zero days, so a number from one system means a different date in another; the 1970 convention is common, not universal. Calendar reforms and historical dates before the modern calendar need special handling.

Time zones and daylight saving affect conversions from timestamps. Always confirm the reference date before exchanging raw day counts.

Understanding Epoch day

Date arithmetic is horrible. Months have different lengths, leap years are irregular, and calendars have historical discontinuities. Converting both dates to a plain count of days since 1 January 1970 removes all of it, because subtracting two integers is something a computer cannot get wrong.

Every reliable date calculator does this underneath.

Using Epoch day

Date calculators, spreadsheets and databases use day counts internally. Date difference tools convert two dates to epoch days and subtract. Programmers store or transmit dates as whole numbers to save space and avoid formatting errors.

Financial software counts days between payments this way; anyone building a schedule, an age calculator or a countdown relies on it, even without seeing it. When a spreadsheet shows a date as a five-digit number, it is showing a day count, though usually from a different starting date.

Epoch day: calculation reference

Days between = end date − start date

Epoch day: assumed inputs and calculated quantities
QuantityEntered or calculated amountMeaning
Start dateJanuary 1, 2026Explicit example input.
End dateAugust 28, 2026Defaults to today.
Days between239Result under the listed assumptions.
Weeks between34.1Result under the listed assumptions.
Days between by Start dateDate Difference and Countdown Calculator. Assumed Start date values and their calculated Days between. End date: August 28, 2026December 18, 2025253December 25, 2025246January 1, 2026239January 8, 2026232January 15, 2026225
Days between by End dateDate Difference and Countdown Calculator. Assumed End date values and their calculated Days between. Start date: January 1, 2026August 14, 2026225August 21, 2026232August 28, 2026239September 4, 2026246September 11, 2026253
Weeks between by Start dateDate Difference and Countdown Calculator. Assumed Start date values and their calculated Weeks between. End date: August 28, 2026December 18, 202536.1December 25, 202535.1January 1, 202634.1January 8, 202633.1January 15, 202632.1

Date Difference and Countdown Calculator: change the inputs and compare the resulting cases

What is day zero?

January 1, 1970 in the common Unix convention. Other systems use different starting dates, so confirm the reference before comparing numbers.

Why not just store the date as text?

Text dates need parsing and vary by format, while a whole number makes sorting and subtraction simple and unambiguous.

How do I convert an epoch day to a date?

Software libraries do it. By hand, add the days to January 1, 1970, accounting for leap years. Date calculators automate the arithmetic.

Watch for time zones. Convert in one zone and back in another and the answer can land a day off.

Epoch day: other glossary lookups