Excel 1900 vs 1904 Date Systems: Fixing Four-Year Date Shifts
Explain serial dates, the leap-year compatibility bug, cross-workbook copying and correction.
Why a Workbook Opens with Every Date Shifted by Four Years and One Day
When an .xls file opens with every date offset by exactly 1,462 days, the cause is a mismatch between the workbook’s internal date base and the application’s expected date base. This is not a formatting error, regional setting, or file corruption. It is a serial-number epoch conflict defined in the binary file specification.
Excel supports two mutually exclusive date systems:
- 1900 date system: Serial day 1 corresponds to January 1, 1900. This is the default for Excel on Windows and, since Office 2011, the default for Excel on Mac.
- 1904 date system: Serial day 1 corresponds to January 1, 1904. This was the default for Excel on Mac before Office 2011 and persists in legacy workbooks from financial and scientific environments.
The offset between the two epochs is 1,462 days. That figure is four years (including one leap day) plus one additional day. The extra day exists because the 1900 system treats February 29, 1900, as a valid date even though 1900 was not a Gregorian leap year. Microsoft documents this intentional deviation in the MS-XLS specification as a compatibility decision carried forward from Lotus 1-2-3. The 1904 system does not include that fictitious leap day, so the gap is 1,462 days rather than 1,461.
How the Date System Flag Is Stored in the XLS Binary Format
The workbook’s date system is a single boolean field inside the file’s binary structure. According to the Microsoft Open Specifications document MS-XLS, the flag resides in the Date1904 field of the Workbook global record (section 2.4.106). A value of 0 specifies the 1900 date system; a value of 1 specifies the 1904 date system.
No per-cell metadata records which epoch a given serial number belongs to. A cell containing a date is stored as a floating-point number with an XF index that references a date format string. The interpreting application applies the workbook-level Date1904 flag to every such cell. If the flag is wrong for the data, every date shifts.
Checking Which Date System a Workbook Uses
You can determine the date system without inspecting the binary file directly.
In Excel (Windows, version 2010 and later)
- Open the workbook.
- Select File > Options.
- Choose the Advanced category.
- Scroll to the When calculating this workbook section.
- The checkbox Use 1904 date system reflects the workbook’s flag. If checked, the workbook uses the 1904 system. If cleared, it uses the 1900 system.
On Excel for Mac (version 2011 and later), the same checkbox appears under Excel > Preferences > Calculation.
In LibreOffice Calc
- Open the file.
- Go to Tools > Options > LibreOffice Calc > Calculate.
- The Date section shows the base date.
12/30/1899corresponds to the 1900 system;01/01/1904corresponds to the 1904 system.
By Inspecting a Known Date
- Enter a date whose serial number you know independently, such as
2000-01-01. - If the cell displays
2000-01-01, the workbook’s date system matches the application’s current default. - If the cell displays
1996-01-02(shifted backward by 1,462 days) or2004-01-02(shifted forward by 1,462 days), the workbook uses the opposite system.
Correcting Dates When You Control the Destination Workbook
The arithmetic correction is straightforward, but it does not alter the file’s Date1904 flag.
Shifting from 1904 to 1900 (Dates Appear 1,462 Days Too Late)
- Select all cells that contain dates.
- In an empty cell, type
1462. - Copy that cell.
- With the date range still selected, use Paste Special.
- In the Paste Special dialog, select Values under Paste and Subtract under Operation, then click OK.
- Confirm the correction: a cell that should display
2000-01-01now displays2000-01-01, not2004-01-02.
Shifting from 1900 to 1904 (Dates Appear 1,462 Days Too Early)
Follow the same steps, but choose Add in the Paste Special Operation instead of Subtract.
Explicit limitation: This procedure changes only the serial numbers. The workbook’s Date1904 flag remains unchanged. If you save the file as .xls and reopen it in an application that respects the flag, the shift reappears. To make the correction permanent, either save the workbook as .xlsx (which defaults to the 1900 system and does not preserve the legacy flag) or clear the Use 1904 date system checkbox in the workbook’s calculation options before saving.
What Happens During Cross-Workbook Copy Operations
Copying cells between workbooks with different date systems copies the raw serial numbers. The destination application interprets those numbers against its own date base.
Example:
- Source workbook (1900 system): serial number
36526represents2000-01-01. - Destination workbook (1904 system): serial number
36526represents2004-01-02.
The pasted cell displays 2004-01-02. The 1,462-day offset is introduced silently because no metadata travels with the copied value to indicate the original epoch.
The XLS binary format provides no mechanism to tag an individual cell with a date system override. The Date1904 flag is a workbook-global property. Any workflow that merges data from 1900 and 1904 workbooks must normalize one set of dates to the other epoch before combining them.
Hard Limits and Unrecoverable Cases
- Dates before March 1, 1900, in the 1900 system: The fictitious February 29, 1900, means serial numbers for January 1 through February 28, 1900, are off by one day. Excel calculates February 29, 1900, as serial number 60, pushing all earlier dates forward. There is no corrective arithmetic that fixes this while keeping the dates as serial numbers. Manual adjustment or acceptance of the one-day error is the only option.
- Dates before January 1, 1904, in the 1904 system: The 1904 system cannot represent dates earlier than its epoch as serial numbers. Such values are stored as text strings or generate errors. No conversion can recover them as calculable dates.
- Mixed-epoch workbooks: A single
.xlsfile can carry only oneDate1904flag. If you combine data from a 1900 workbook and a 1904 workbook into one file, you must shift all dates from one source by 1,462 days before merging. The merged workbook will then have a single, consistent date system.
Verifying the Correction Programmatically
In automated pipelines that process XLS files without opening Excel, you can validate the fix by reading the binary structure directly.
- Parse the XLS file to locate the
Workbookglobal record. - Read the
Date1904field at the offset specified in MS-XLS section 2.4.106. - For every cell whose XF index points to a number format in the date category, extract the floating-point serial number.
- If the
Date1904field is1and the target output uses the 1900 system, subtract1462from each date serial number. - Write the corrected serial numbers to the output file and set the output file’s
Date1904flag to0.
Not all XLS conversion libraries perform this adjustment. After any batch conversion, spot-check a known date in the output to confirm the epoch was handled correctly.
Reference
Microsoft Open Specifications: MS-XLS — Excel Binary File Format (.xls) Structure