Error with "Date" format in Excel

Describe the problem/error/question

When I upload a Excel file containing a column in “Date” format, I get numbers in my json in n8n.

Note that this issue is similar to many issues around 2022/2023 and that these issues seem to be solved by using the “Extract from file” node.

This is my Excel file example. The “C” column uses the “Date” format.

What is the error message (if any)?

Please share your workflow

Share the output returned by the last node

Information on your n8n setup

  • n8n version: 1.116.2
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): n8n cloud
  • Operating system: W10

Many thanks,

Hi @Wandefear

I don’t think this is an error, it’s just how Excel stores dates..
The n8n “Extract from File” node is simply outputting what it receives from Excel..

Your options are:

  • Convert the date yourself using custom code or a Set node, for example:
{{ new Date((($json['Your excel date column'] - 25569) * 86400 * 1000)).toISOString() }}
  • Or if possible, avoid using Excel files and export the file as a CSV instead, or even use Google Sheets, to get the exact values you see (without Excel’s internal date formatting).
  • If you’re self-hosting n8n, use Python libraries to deal with Excel files..
1 Like

Hi @mohamed3nan

First of all, thank you for your quick response!

I saw these solutions i previous posts but it seems strange to me that Excel’s “Date” format isn’t supported (I know Office file formats are awful!), and I was hoping to find a better solution three years after these initial posts.

But I will use your code block.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.