All guides

Why are my dates wrong after opening a CSV file?

Veritaproof ยท

A client sends a CSV of orders. You open it in Excel, and something is off: some dates look fine, others are stuck to the left of the cell, and a few sales seem to have happened in December when the file only covers November.

Dates are the most common way a data file goes quietly wrong, because nothing errors. The file opens, the numbers add up, and the transactions sit in the wrong month. Here are the usual causes, how to recognise each one, and how to fix it.

1. Day and month have swapped

What you see: some dates are right, some are wrong, and some aren't treated as dates at all.

A CSV file stores dates as plain text, such as 02/11/2026. It doesn't say whether that's 2 November (UK) or 11 February (US). The program opening it guesses, usually from your computer's region setting.

If the file was written month-first and your computer is set to the UK, Excel reads 02/11/2026 as 2 November when it was 11 February. A date like 11/25/2026 can't be the 11th of the 25th month, so Excel gives up and leaves it as text. That's the giveaway: a column where some dates are right-aligned (real dates) and some are left-aligned (text).

How to tell: sort the column, or look for days above 12. If every value with a first number above 12 is stuck as text, the file is the other way round from your settings.

How to fix it: don't double-click the file; import it and say which order the dates are in.

  • Excel: choose Data, then From Text/CSV, then Transform Data. Right-click the date column, choose Change Type, then Using Locale, and pick Date with the country the file came from (English (United States) for month-first).
  • Google Sheets: the spreadsheet's locale decides. Set it under File, Settings, Locale before importing.
  • Python (pandas): say so explicitly, for example pd.to_datetime(df["order_date"], format="%d/%m/%Y"). Giving the exact format is safer than dayfirst=True, which is only a hint.

2. The format changed partway down the file

What you see: the first few thousand rows are fine, then the dates go strange.

This happens when a file is built from several exports appended together, or when someone changed a setting in the client's system mid-period. The top half says 2026-11-02 and the bottom half says 02/11/2026.

How to tell: scroll to the bottom as well as the top, or filter the column for values containing / and - separately. If both exist, the file mixes formats.

How to fix it: convert each part with its own format, then combine them. And tell the client: whatever changed will keep happening.

3. Dates have turned into numbers like 45962

What you see: a column of five-digit numbers where dates should be.

Excel stores dates as the number of days since 1900, so 1 November 2025 is 45962. If a client's file was saved from Excel with the column formatted as a number, or exported by a system that copied Excel's internal values, you get the numbers instead of the dates.

How to fix it: in Excel, format the column as a date. In Python, pd.to_datetime(df["order_date"], unit="D", origin="1899-12-30") turns them back.

4. Every date is four years and one day out

What you see: dates that are consistently four years and a day off.

Excel on Mac once counted days from 1904 rather than 1900, and a workbook can still be set to the 1904 system. Copy dates between workbooks on different systems and every date moves by 1,462 days.

How to fix it: check File, Options, Advanced, "Use 1904 date system" in both workbooks, and make them match before copying.

5. Everything is a day early

What you see: sales from just after midnight appear on the previous day.

The client's system stored times in UTC (Greenwich time) and you're reading them as UK time, or the other way round. In summer, UK time is an hour ahead of UTC, so an order at 00:30 on 1 July in London is stored as 23:30 on 30 June.

How to tell: look for times between 23:00 and 01:00 near the start and end of the period. If the client's export includes a time zone (2026-07-01T00:30:00+01:00 or a trailing Z for UTC), use it.

How to fix it: convert to one time zone before you take the date, and agree with the client which one their reports should use.

6. Two-digit years

What you see: dates in the 1920s, or decades in the future.

01/02/29 is ambiguous about the century as well as the day and month. Excel and other tools have cut-off rules for deciding which century a two-digit year belongs to, and they don't all agree.

How to fix it: ask the client to export four-digit years. Until then, convert with an explicit format and check the earliest and latest dates make sense.

Ask for ISO dates

The single best fix is upstream. Ask each client to export dates as YYYY-MM-DD, for example 2026-11-02. It's an international standard (ISO 8601), every tool reads it the same way, it sorts correctly as text, and it can't be read the wrong way round.

Check the dates in every file

Whatever format a client uses, the thing to watch is change: a file whose dates look different from last week's. Two quick checks catch most problems:

  1. The range: the earliest and latest dates should match the period you were promised.
  2. The format: the share of values in the usual format should stay at 100%.

For more checks like these, see how to check a client's data export before you report on it.

Veritaproof checks date formats automatically in every file, comparing each one with that dataset's history. When a date column switches format partway through, it says so plainly, for example "order_date: values in an unexpected format rose from 0.0% to 12.0%." You can try the free check on last week's file and this week's; it runs in your browser and nothing is uploaded.