When CSV dates come out wrong, the file often holds a day/month/year date and the program reads it as month/day/year, or the other way round. Re-import the original file with its known date order, then save the column in an unambiguous format such as YYYY-MM-DD. Changing the display format cannot repair a date that was already read backwards. CSVPrune from Automata Labs offers local date coercion, column profiling and saved cleaning recipes, but no cleaner can infer whether an ambiguous value such as 03/04/2026 means March 4 or 3 April without source information.
Standardize a messy date column without uploading the file anywhere.
Get it fromMicrosoft
Why do dates in a CSV change when I open it?
A CSV file is plain text. It does not store a date type, only the characters someone typed or exported, such as 03/04/2026. The program that opens the file has to guess what those characters mean.
Excel’s interpretation depends on the import path and regional settings. With a month-first format, 03/04/2026 means March 4; with a day-first format, it means 3 April. If the source uses day first but the importer expects month first, some rows can become wrong dates while others, such as 25/04/2026, remain text or produce errors because there is no 25th month.
Excel can also turn values into dates that were never dates. Microsoft’s automatic data conversion documentation describes the option for converting continuous letters and numbers to a date, using JAN1 as the example. Even with that option off, values such as JAN 1 or JAN-1 may still be treated as dates. These settings are available in Microsoft 365 and Excel 2024; they do not control Power Query’s type conversions.
The ISO page on ISO 8601 gives the classic example of the problem: 01/05/22 could mean January 5 or May 1, depending on who wrote it. ISO 8601 removes the guess by writing the year first, then month, then day: 2026-04-03.
How do I tell which date order my CSV uses?
Do this before you convert anything:
- Look for a day above 12. Between DMY and MDY,
25/04/2026can only be day first, and04/25/2026can only be month first. That establishes the order of that row, not necessarily the whole column. - Check the source. Read the export settings or documentation. A country or language alone is not proof of the format, especially in exports assembled from several systems.
- Check a known record. Find a row whose real date you know, such as your own last order, and see how it is written.
- Watch for mixed columns. Both
25/04and04/25patterns in one column suggest mixed formats or bad entries. Group rows by their verified source format and handle them separately; do not guess the ambiguous rows.
If every value in a column has a day of 12 or lower, the order cannot be proven from the data alone. Use the source system’s documentation or a known record.
How do I import CSV dates correctly in Excel?
Do not double-click the CSV. Use an import path that lets you set the date order.
Text Import Wizard (legacy). Microsoft’s Text Import Wizard guide explains how to enable From Text (Legacy) in File > Options > Data, then open it from Data > Get Data > Legacy Wizards. In Step 3, select the date column, choose Date, and pick the source order: DMY, MDY or YMD. An order that does not match the data can make Excel fall back to General instead.
Power Query with a locale. Open Data > From Text/CSV > Transform Data. Before converting, remove or replace an automatic Changed Type step that has already interpreted the date column incorrectly, so you are working from the original text. Microsoft’s data types guide documents Change type > Using locale: choose Date and a locale matching the source, such as English (United Kingdom) for day/month/year. Check known rows and, if needed, extract day, month and year columns to verify the result. Changing the locale after a silent day/month swap does not restore the original meaning.
Keep it as text. If you only need to pass the file to another system, import the column as Text before any date conversion. Keep an untouched copy of the original export.
Which date format should I save the CSV in?
| Format | Example | Sorts correctly as text | Ambiguous | Typical use |
|---|---|---|---|---|
| YYYY-MM-DD (ISO 8601) | 2026-04-03 | Yes | No | Databases, imports, sharing across countries |
| MM/DD/YYYY | 04/03/2026 | No | Yes, for days 1 to 12 | US-only tools that require it |
| DD/MM/YYYY | 03/04/2026 | No | Yes, for days 1 to 12 | Local tools that require it |
| YYYY-MM-DDThh:mm:ssZ | 2026-04-03T18:00:00Z | Yes, with consistent precision and all values in UTC | No | UTC timestamps |
Use YYYY-MM-DD unless the receiving system documents another format. Consistently zero-padded, four-digit-year dates sort correctly as text. For timestamps, preserve the time zone or offset; append Z only after converting to UTC, not to an unexplained local time. If the file contains Unix timestamps, see seconds vs milliseconds since 1970 before converting them.
Export correctly parsed dates as YYYY-MM-DD
For a correctly imported Excel date in A2, enter =TEXT(A2,"yyyy-mm-dd") in a new column and fill down through the populated date rows. Microsoft’s TEXT function guide explains this conversion from a numeric value to formatted text. This is an English-language Excel formula; localized function names or separators can differ. Leave genuinely missing dates blank rather than formatting blank cells as dates.
Copy the results as values into a Text-formatted export column, save a new CSV, then inspect it in a text editor before sending it onward. Verify both the date meaning and the literal output. Reopening the CSV by double-clicking can make Excel interpret the values again.
Profile date columns and keep a before/after record with an audited export.
Get it fromMicrosoft
How does CSVPrune help clean a date column?
- Open the CSV in CSVPrune. It supports UTF-8, UTF-16 and Latin-1, with automatic comma, semicolon and tab detection and manual overrides. Its virtualized grid supports large files; the documented export ceiling is about 500 MB, so file size and available memory still matter.
- Profile the date column. Profiling surfaces invalid values. A date that is valid in both DMY and MDY may not be flagged, so profiling is not proof of the intended order.
- Use date coercion only with a known interpretation. Test known rows before applying a saved pipeline to the full file. If the available conversion cannot express the source’s format reliably, normalize the dates with the explicit Excel import method above first.
- Check original against cleaned data. Retain the original CSV and use the audited export’s before/after sidecar when you need a change record. Check both dates above 12 and ambiguous dates with a known meaning.
- Fix leftovers deliberately. Use column-scoped find and replace for known, consistent patterns. Changing separators alone cannot resolve day/month ambiguity.
- Save a recipe. Replay the verified steps on a later export only after confirming that its source format has not changed.
- Export and inspect. Save as CSV, JSON or XLSX. Check the exported date strings against the destination’s required format before importing them.
Parsing and cleaning run locally, with no upload, telemetry or app network calls. Exported files and audit sidecars remain sensitive files that you should store appropriately.
What else breaks in the same exports?
Date problems rarely travel alone. The same files often have:
- Lost leading zeros in postal codes and IDs. See why Excel removes leading zeros.
- Garbled accents from the wrong encoding. See CSV UTF-8 vs CSV comma delimited and fixing CSV encoding and delimiters.
- Broken rows from commas or line breaks inside fields. See RFC 4180 quoting rules.
Frequently asked questions
Why are some dates converted and others left as text?
The program read the column using one order. Values that fit that order became dates, some of them wrong, and values that did not fit, such as a 25th month, stayed as text. Re-import with the correct order rather than fixing rows by hand.
Can I change my Windows region to fix it?
It can make an import read correctly, but it also affects other programs that use those regional defaults. Setting the order for this import, or using a locale in Power Query, is more controlled.
Is YYYY-MM-DD accepted everywhere?
It is the ISO 8601 date format and most modern systems accept it. Some import tools ask for a specific format, so check the target system’s own import documentation.
Does CSVPrune send my file anywhere?
No. It works offline with no telemetry and no network calls.
Try CSVPrune
Get CSVPrune from the Microsoft Store. It is a one-time purchase with no subscription, and the Store listing shows the current price.
Clean dates, IDs, encodings and duplicates in one private Windows app.
Get it fromMicrosoft
Microsoft, Excel, Power Query and Windows are trademarks of the Microsoft group of companies. ISO is a trademark of the International Organization for Standardization. CSVPrune is not affiliated with or endorsed by Microsoft or ISO.
Last updated 28 October 2026. Published by Automata Labs, a software company in Canada.