Guide · updated 2026-11-04
Parsing dates when formats are ambiguous
ISO, slash dates, locales and impossible days: rules that never guess.
Prefer ISO
YYYY-MM-DD is unambiguous. Accept it for every locale.
Slash dates need a locale
03/04/2026 is March 4 in the US and 3 April in the UK. Parse slash dates with each row's declared locale and quarantine those with an unknown or missing locale.
Reject impossible days
2026-02-30 must be quarantined. Some parsers roll it over to March 2 without warning, so test your tool's behaviour.
Practise it
- Lesson: Dates need a declared locale
- Exercise: Parse dates by declared locale