Excel Date Serial to Unix Timestamp

A spreadsheet date is not a date: it is a count of days since an epoch Excel invented, carrying a bug that pretends 1900 was a leap year. Paste a serial — or a UTC date — and get both directions, on either date system.

[SEC.01 // CONVERT]

Excel serial → date (and back)

EXACT DAY MATH

Enter a value to see results below. Accepts a serial (whole days plus a fraction of a day on the workbook's date system) or a UTC date such as 2026-01-01 09:30:00 — both directions come out below.

Workbook date system
Excel serial —
Date (UTC) —
Unix seconds (s) —
Unix milliseconds (ms) —

The 1900 system is the Windows default; 1904 comes from old Macintosh files and sits 1462 days behind it. A whole second is 1/86400 of a day, which never ends in a finite decimal — that is why an Excel time imported through a spreadsheet can land one millisecond early. Copy the serial from this row instead of retyping it.

[SEC.02 // TWO BASES ONE BUG]

The serial number is days since an invented base date

LOTUS 1-2-3, STILL HERE

Excel stores a date as days since a base date, with the time of day as the fraction: 46023.39583333333 is a day number plus roughly nine-thirty in the morning. In the 1900 system serial 1 is 1900-01-01, which puts the base date at 1899-12-31 — except that Lotus 1-2-3 counted a nonexistent 1900-02-29 and Excel kept the bug for compatibility, so from serial 61 onward the effective base is 1899-12-30. Two base dates, one column format:

SerialExcel printsReality
11900-01-01correct
591900-02-28correct
601900-02-29does not exist — 1900 is divisible by 100 but not by 400, so it was not a leap year
611900-03-01correct
255691970-01-01the Unix epoch — and the reason this number appears in every conversion library
  • The arithmetic the widget runs: unix_ms = Math.round((serial - 25569) * 86400000) for serials 61 and up, and Math.round((serial - 25568) * 86400000) for 1 <= serial < 60. A library that hard-codes 25569 for the whole column is exactly one day wrong for the first two months of 1900 — which is why historical data imported through those libraries shows births and inventors' patents shifted by a day.
  • The interval [60, 61) has no answer in the 1900 system. The widget refuses the phantom day and all its fractional times instead of guessing: there is no instant to hand back, and a silent conversion is how a phantom date gets written into a real database.
  • The 1904 system (old Macintosh workbooks, still selectable) starts serial 0 at 1904-01-01 and has no phantom day at all. The two systems are exactly 1462 days — four years and one day — apart, which is the signature of the "my dates moved four years" bug when a file crosses between them.
[SEC.03 // PRECISION AND FORMULAS]

Day fractions and rounding to milliseconds

1 SECOND = 1/86400 DAY

Many second values are not exactly representable as binary floating-point day fractions. Shortening 09:30:00 to the fraction 0.3958333333 introduces a tiny error, but this widget rounds the converted value to the nearest millisecond: that example still displays 09:30:00.000, not 09:29:59.999. Losing more digits can change the rounded result; the returned serial is recomputed from that millisecond value.

  • Spreadsheet out of Excel: =(A1 - 25569) * 86400 gives Unix seconds for serials 61 and up; use - 25568 for the first 59, and a 1904 file subtracts 24107 instead.
  • Into Excel from a Unix column: =A2 / 86400 + 25569 and apply a date format. In a 1904-system workbook, using 25569 makes the result 1462 days late; use 24107 instead.
  • Google Sheets shares Excel's base date — =DATE(1970,1,1) renders 25569 — so the same formulas port, but Sheets has its own display truncation of long decimals.
  • Python. openpyxl and pandas.read_excel hand you real datetime objects, so the serial only shows up in CSV exports and clipboard paste. If your CSV dates are whole numbers, that is where the conversion belongs — datetime(1899, 12, 30) + timedelta(days=v) for serials ≥ 61.

Value versus display matters when pasting: copying a formatted cell as text gives you 1/1/2026 9:30 AM (locale-dependent, and unusable here), while copying the cell contents gives you the serial. The widget takes the serial, and also takes a bare UTC date like 2026-01-01 09:30:00 — at which point it is your job to know whether the spreadsheet meant that wall clock in UTC or in an office timezone. See the date-to-timestamp page for why that assumption breaks schedules.

[DOC.FAQ // INDEX]

ANSWERS

05 ITEMS
01 How do I convert an Excel date serial to a Unix timestamp?

Subtract the base and multiply by the number of seconds in a day: (serial - 25569) * 86400 for serials 61 and higher in the 1900 system, (serial - 25568) * 86400 for serials 1–59, and (serial - 24107) * 86400 in a 1904-system file. Keep the decimal part if you need the time of day.

02 Why does Excel think 1900 was a leap year?

Compatibility. 1900 was not a leap year (a century year is only a leap year when divisible by 400), but Lotus 1-2-3 treated it as one, and Excel kept the phantom 1900-02-29 so that Lotus files would import unchanged. The entire cost of that decision is the one-day gap in this page's first two months of 1900.

03 What is Excel serial 60?

The fictitious 1900-02-29. The entire interval 60 <= serial < 61, including fractional times such as 60.5, has no corresponding Gregorian instant. The widget rejects that whole interval in the 1900 system; serial 60 is valid in the 1904 system.

04 How do I tell whether a workbook uses 1900 or 1904?

Open it and look at a known date: a 1904-system file shows dates four years and one day later than the serials imply when read in 1900 mode (Excel for Windows: File → Options → Advanced → "When calculating dates, use 1904 date system"; Excel for Mac: Workbook properties). If dates you re-import land 1462 days off, that is the cause.

05 What serial is 2026-01-01?

46023 in the 1900 system, 44561 in the 1904 system — 1462 apart. With a 09:30 time of day the 1900 serial is 46023.39583333333, i.e. 2026-01-01 09:30:00 UTC = Unix second 1767259800. The widget rounds to the nearest millisecond, so even a slightly shorter fraction can still produce 09:30:00.000. It recomputes the serial from the rounded millisecond result rather than echoing the input.

[SEC.MATRIX // RELATED]

Related tools

3 PAGES

Sources and specifications