{
  "id": 11951127,
  "title": "My XLSX converter shipped a due date as 45852 — Excel dates are serial numbers, not strings",
  "url": "https://urgent.news/2026/10/04/my-xlsx-converter-shipped-a-due-date-as-45852-excel-dates-are-serial",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-10-04T15:34:18.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/imapphelp/my-xlsx-converter-shipped-a-due-date-as-45852-excel-dates-are-serial-numbers-not-strings-2j8p"
  },
  "original_language": "en",
  "account": "I discovered an issue while testing a client's invoice pipeline: a spreadsheet listed a \"Due date\" column as 14/07/2025, but my converter's Markdown output displayed 45852. This is not a rendering error, but rather a fundamental difference in how Excel stores dates. Excel represents dates as serial numbers, indicating the number of days elapsed since December 30, 1899. The chosen anchor date is a leftover from Lotus 1-2-3, a software that erroneously considered 1900 to be a leap year. Consequently, Excel assigns serial number 60 to a date that never actually existed.\n\nThe human-readable date you see in Excel, such as dd/mm/yyyy, is actually a number format code attached to the cell's style in the sheet data. The actual numeric value, like 45852, resides in the file. Similarly, percentages and booleans are also stored as simple numbers. For percentages, 0.175 is stored, but displayed as 17.5%. Booleans are stored as 1 (true) and 0 (false).\n\nThis numerical representation can lead to misunderstandings if not properly handled. A downstream job once treated the serial number 45852 as a quantity and scheduled a reorder based on that, whereas it should have been a deadline. To address this, I implemented a fix in my XLSX-to-Markdown converter. The fix involves reading each cell's style, checking for date/time format codes, and then converting the serial number to a datetime using the 1899-12-30 anchor. Additionally, it takes into account the 1904 date-system flag used in some Mac-era workbooks, which shifts the dates by 1,462 days.\n\nThe converter now accurately outputs the date as 2025-07-14 instead of the raw serial number 45852. It also properly displays percentages and handles fractional serial numbers, which include time-of-day information. The final output reads the human-friendly date and ensures that percentage cells render the correct human-facing values throughout the invoice file it processes. This fix is available in my XLSX-to-Markdown converter (https://x402.freeq.one/tools/xlsx_to_markdown.html), which also returns a JSON array of row objects.\n\nFor anyone feeding spreadsheets into RAG (Retrieval-Augmented Generation) or agent pipelines, it is crucial to parse the style first before outputting raw cell values. Failing to do so may result in agents misinterpreting data, potentially leading to incorrect actions based on erroneous information.",
  "summary": "I spotted this while testing a client's invoice pipeline: a spreadsheet whose \"Due date\" column displayed 14/07/2025 in Excel. My converter's Markdown output listed 45852 . Not a rendering bug — that's literally what the file stores. The stored value and the displayed value in a spreadsheet are two different things. Excel keeps dates as serial numbers: days elapsed since 1899-12-30. The odd…",
  "key_points": [
    "Excel stores dates as serial numbers, not strings",
    "Serial number 45852 represents 14/07/2025 in Excel",
    "Converter fixed to display human-readable dates"
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}