Contact

CSV and dates · 8-minute guide

CSV Dates Changed or Imported as Text: How to Diagnose Them

Diagnose date-like strings, ambiguous regional dates, incorrect CSV auto-conversion and true date values using a controlled Calc ISO-date example.

A CSV is plain text; it does not preserve the source workbook’s cell types and date formatting. A string like 03/04/2026 could mean March 4 or April 3 depending on its source convention. A spreadsheet may also leave it as text. Don’t guess the meaning from the appearance alone.

Check whether the value is text or a real date

In LibreOffice Calc, if A2 contains a date-like value, try:

=ISNUMBER(A2)

Calc stores real dates using numeric values plus date formatting, so a valid date cell should be recognized as numeric. A string still stored as text generally returns FALSE. This is a diagnostic check, not proof that an ambiguous date was interpreted the intended way.

Source string Safe interpretation Action
2026-10-11 Four-digit year–month–day if the source specifies ISO order Convert with explicit components when needed
03/04/2026 Ambiguous without source convention Ask whether the source uses day/month or month/day
00123 Could be a code, not a date Import as text if it’s an identifier
2026-10-11 09:30 Date plus time if the source format is documented Verify timezone and imported time value

Convert a known ISO date string in Calc

If cell A2 is text 2026-10-11, use this formula in a new cell to construct a date from explicit year, month and day values:

=DATE(VALUE(LEFT(A2;4));VALUE(MID(A2;6;2));VALUE(RIGHT(A2;2)))

Format the result as a date. Expected calendar date: 11 October 2026. Adding 7 days to a genuine date result should display 18 October 2026 when the result cell uses date formatting. Keep the original text column until all imported rows pass validation.

This approach assumes the exact ten-character YYYY-MM-DD input form. It does not validate every malformed date; functions may normalize out-of-range date components depending on the program. Reject invalid strings before applying it to a large dataset. A generic DATEVALUE(A2) can also work, but its interpretation can depend on locale settings.

Download the sample import CSV to inspect an ISO date, an ambiguous regional date, and leading-zero identifiers. Treat this as source text, not a file of verified date-cell values.

Fix the import rather than repairing thousands of cells afterward

  1. Inspect the raw CSV with a plain-text viewer or the CSV Import Doctor.
  2. Determine the documented source date convention, ideally from the exporting system.
  3. Use the spreadsheet program’s CSV import dialog rather than double-clicking blindly.
  4. Set ambiguous identifier columns to text. For date columns, specify the known date order only when it is truly known.
  5. Preview several edge cases: days above 12, month boundaries, empty values and mixed date/time strings.
  6. Import to a new workbook or sheet, then reconcile several source records before saving.

Import controls differ across LibreOffice, Apple Numbers, ONLYOFFICE, Zoho Sheet and other spreadsheet programs; do not assume a menu label is identical on every platform.

If the dates already changed

If the original CSV still exists, reimport it correctly. Reformatting a cell changes presentation, not necessarily the value’s original interpretation. If you no longer have the original and 03/04/2026 was turned into the wrong serial date, a display format cannot tell you what the author intended.

For LibreOffice-specific steps, see Convert imported text to dates and Prevent date conversion during import.

Important file-safety note

Untrusted CSV values that begin with certain special characters can be interpreted as spreadsheet formulas. Treat suspicious exports cautiously rather than editing or pasting dangerous-looking cells into a live workbook. OWASP explains CSV formula injection. The CSV Import Doctor flags suspicious-looking fields; it is not a malware scanner.

Verification note: Official LibreOffice CSV guidance and common date-function semantics were reviewed. The ISO-date and seven-day examples were independently checked as calendar arithmetic; this page did not execute formulas in LibreOffice Calc or other spreadsheet software. No real application screenshots are included.