Correct date format

How to find dates in text, recognize their date and time format, pick the best format for your purpose, and check results without altering meaning.

There is no single correct date format for every situation. The right choice depends on where the date will be read or processed. A US reader expects month-first dates such as 10/31/2026. Most of the world reads 31/10/2026 day-first. Software and data files work best with an unambiguous form such as 2026-10-31. Before you convert dates, you usually need to find them in your text and work out which format each one uses. This guide covers both tasks.

What a date extraction tool does for your text

A date extraction tool scans plain text and locates strings that look like calendar dates, times, or both. Its input can be prose, log files, spreadsheets exported as text, email bodies, or any other unstructured content. Its output is typically a list of matches. Each match can include the original text, its position in the document, the format the tool believes it follows, and sometimes a normalized version such as an ISO 8601 date.

The scope that matters most is whether the tool only reports matches or also rewrites them. Reporting leaves your text untouched. Rewriting, such as converting every date to one format, changes content, so it needs review. No evidence about a specific product was supplied for this article. The behavior described here is the general pattern for this kind of tool. Check your tool's documentation for its actual supported formats, languages and output options.

Common date and time formats you will meet

Format | Example | Where it is common | Ambiguous?
YYYY-MM-DD (ISO 8601) | 2026-10-31 | Data files, APIs, databases, file names | No
MM/DD/YYYY | 10/31/2026 | United States | Yes, when the day is 12 or lower
DD/MM/YYYY | 31/10/2026 | Much of Europe, Latin America, Asia | Yes, when the day is 12 or lower
DD.MM.YYYY | 31.10.2026 | Germany, Russia and other countries | Usually read day-first
Month D, YYYY | October 31, 2026 | US prose and formal writing | No
D Month YYYY | 31 October 2026 | UK and international prose | No
ISO 8601 date and time | 2026-10-31T14:30:00-04:00 | Logs, timestamps, data exchange | No
12-hour time | 2:30 PM | US everyday use | No, if AM/PM is present
24-hour time | 14:30 | Military, transport, most countries | No

The example values in this table are illustrations of each pattern, not output from any tool.

Which date format is best

  • For data, file names and anything a program will read: use ISO 8601, YYYY-MM-DD. It cannot be confused between month-first and day-first readers, and dates in this form sort correctly as plain text.
  • For US readers in documents and messages: write the month as a word, as in October 31, 2026. Use the numeric form 10/31/2026 only when you are sure every reader expects month-first order.
  • For international audiences: spell out the month, as in 31 October 2026, or use ISO 8601. Avoid all-numeric dates with slashes.
  • For date and time together in data: use ISO 8601 with a time zone offset or Z for UTC, such as 2026-10-31T18:30:00Z.

How to find dates in text and check their format, step by step

  • 1. Decide what you are looking for: dates only, times only, or combined timestamps. Also decide which formats are plausible in your source.
  • 2. Work on a copy of the text, or use a tool mode that reports matches without replacing them.
  • 3. Run the extraction with a date finder or with regular expressions (search patterns written in a compact syntax) tailored to the formats you expect.
  • 4. Review the list of matches. Look for false positives such as version numbers (1.2.2026), fractions (3/4) or product codes that only look like dates.
  • 5. Classify each match by format. Where a numeric date could be read two ways, use context to decide: the document's origin, other dates in the same text, or any day value above 12.
  • 6. Validate that each date exists. A pattern can match 2026-02-30, which is not a real date, and leap years affect February 29.
  • 7. Only after review, convert to your target format if needed. Then compare the converted text against the original to confirm nothing else changed.

Example search patterns

The regular expressions below are illustrative starting points. They have not been tested against a particular engine, and their syntax may need adjusting for your tool. They check shape only, not whether a date is real.

ISO date:        \b\d{4}-\d{2}-\d{2}\b
US numeric date: \b\d{1,2}/\d{1,2}/\d{4}\b
Dotted date:     \b\d{1,2}\.\d{1,2}\.\d{4}\b
Month name date: \b(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)[a-z]*\.? \d{1,2}, \d{4}\b
24-hour time:    \b(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d)?\b
12-hour time:    \b(?:1[0-2]|0?[1-9]):[0-5]\d\s?(?:AM|PM|am|pm)\b

Illustrative input: Invoice sent 10/31/2026 at 2:30 PM; payment due 2026-11-15. In this sentence, the US numeric pattern would be expected to match 10/31/2026. The 12-hour pattern would be expected to match 2:30 PM, and the ISO pattern would be expected to match 2026-11-15. Treat these as expected results to confirm, not verified output.

Ambiguous dates

A date such as 03/04/2026 is March 4 to a US reader and 3 April to many others. The text alone cannot settle it. A tool can flag such dates as ambiguous, but it should not silently pick one reading. Resolve them using the source's locale or nearby dates that are unambiguous, such as 03/25/2026 in the same file, which can only be month-first. If neither is available, ask the author. Two-digit years such as 10/31/26 add a second ambiguity about the century and deserve the same caution.

Time formats and time zones

A time without a zone is incomplete for any comparison across locations. In ISO 8601, a trailing Z means UTC, and an offset such as -04:00 states the difference from UTC. Abbreviations such as EST or CST are less reliable because some are shared by different regions. Also note whether a time is 12-hour or 24-hour. A value like 07:00 with no AM/PM marker is normally read as 24-hour time.

Characters that can break matching

Some characters look identical to ordinary ones but are different. Copied text may contain a non-breaking space (U+00A0) between a month and a day. Recent locale data used by some software places a narrow no-break space (U+202F) before AM or PM. Date ranges may use an en dash (U+2013) rather than a hyphen (U+002D). Whether a pattern such as \s or a literal hyphen matches these depends on the engine and its Unicode settings. If expected matches are missing, inspect the code points of the surrounding characters before assuming the date is absent. Preserve these characters as they are unless changing them is your intended result.

Gaps in this guide

No source evidence about a specific date extraction product was supplied. This guide therefore does not state which formats, languages or time zones any particular tool supports, and it reports no accuracy or speed figures. The patterns and examples are illustrations based on widely documented conventions such as ISO 8601. Confirm them against your own text and tool before relying on them.