I Am So Done With Bad Dates

The Unrepentant Perfidy of Date and Time Formats

A CSV column named OrderDate looks straightforward until you compare values from several suppliers:

2026-10-03
10/03/2026
03-Oct-2026
03/10/2026
2026-10-03 14:30:00

Look at 10/03/2026 and 03/10/2026 side by side. Just… GODDAMMIT. I start frothing and foaming. I bark and howl – there’s a bath-salts drug-dart in the side of my neck. I’m a crispy-fried wriggling marsupial squeaking and honking crazily – I’m tryin’ SO HARD to not destroy my office in a hurricane of rage. Just that little switcheroo of the day and month… Look what I’m reduced to.

Some of these are easy to read. Others are ambiguous. Some constitute a pocket universe of Pure Semantic Hazard. The goal of normalization is not simply to make them look consistent. It is to establish what each value means, then represent that meaning consistently without inventing, damaging, or losing information. MOST IMPORTANTLY: LOCK DOWN A Date/Time/Datetime FORMAT STRATEGY and normalize to it with full intention and all haste.

PRO TIPS

  • If you have to wrangle Dates & Times with any recurrence, you need to know about ISO – 8601. ISO – 8601 is the International Standard for Dates and Times. Google it. Yeah, its a pretty thick read – but its the foundation upon which any serious CSV Transform Tool will approach this stuff.
  • Say ‘CANONICAL’. Now say it a bunch of times real fast and it becomes McGonagall from Hogwarts. See?

Begin with the source’s date convention

The value 03/10/2026 could mean March 10 or October 3. Both are calendar-valid. A computer cannot reliably choose between them just by inspecting that string. Look for ANY evidence one of those two bits is a number 13 or higher – Now you know THAT one isn’t the ‘Month’. Any Date Format that sets the YEAR in the last position is just sloppy – avoid those.

The right interpretation depends on an explicit source rule: perhaps one supplier promises MM/DD/YYYY, while another promises DD/MM/YYYY. Geographic assumptions can be clues but are a weak replacement for a stated contract. Even one vendor may change export conventions between products. Simply stated: Roll up the sleeves and REALLY Look at the data.

If you cannot establish the convention, the correct operational response is to flag the ambiguous value rather than guess. Again, a single record can be mysterious – but a collection of records can point to “which is actually what”.

PRO TIPS

  • There are some default ISO 8601 formats that express each of Dates, Times, and Datetimes. Do the right thing – normalize on one of those. IMPORTANT: Your Canonical format must be SORTABLE. This requires sequencing the parts Largest-To-Smallest. This means BOTH of 10/03/2026 and 03/10/2026 (’10’ is Month here) are NOT SUITABLE as Canonical expressions, whereas THESE ARE: 2026/10/03 and even better 2026-10-03. See the difference?
  • Use the ZERO-Prefix Padding Technique! Do THIS: 2026-10-03 – and NEVER do this: 2026-10-3. Same goes for the middle month part. Do THIS: 2026-06-18 – and NEVER do this: 2026-6-18. And 2-digit YEARS are right out – use all 4 (YYYY).
  • Philistines who advocate MM/DD/YYYY must be punished.

Standardize the target format

If you’ve read my other articles – by this point the terms ‘convention’, ‘locking down formats’, and ‘standardize’ should have keyed your memory to the magic words: CANONICAL FORMAT. I’ll leave it there. You know what it is.

For a date-only field, an unambiguous target such as YYYY-MM-DD is almost always best:

Source value Proven source format Normalized value
10/03/2026 MM/DD/YYYY 2026-10-03
03/10/2026 DD/MM/YYYY 2026-10-03
03-Oct-2026 DD-MMM-YYYY, English month names 2026-10-03
2026-10-03 YYYY-MM-DD 2026-10-03

EYEBALLS: Use the LAST one in the table above. If you see any of the others – you would be wise to normalize all Dates to YYYY-MM-DD.

Notice that two very different strings can describe the same date once their source conventions are known. The reverse is also possible: identical-looking strings can mean different dates under different conventions.

A useful rule configuration therefore needs both an input interpretation and an output representation (‘Canonical’ and ‘Presentation’). “Make the dates consistent” is not a specification. Once you make the conceptual adjustment that ‘Canonical Format’ is an internal Data Processing Pipeline convention and ‘Presentation Format’ expresses variable OUTPUTS – this all makes more sense. But most importantly, you are empowered to LOCK DOWN THE SPEC with a Canonical Format uncontaminated by presentation considerations.

PRO TIPS

  • In ISO – 8601 the characters in formats like YYYY-MM-DD are technically called pattern characters or less formally symbols.
  • On rare occasions you may see CCYY-MM-DD instead of YYYY-MM-DD. The CC pattern characters mean CENTURY. This mattered a bit more a long time ago around the infamous Y2K Problem. You don’t see it much anymore. You should prefer this: YYYY-MM-DD. As in USS Virginia (SSN-774) 1999-12-31 right about 23:59:59.99999, thereabouts.
  • You may be confronted by hominids with “I don’t like YYYY-MM-DD!”. Remember: Whatever extracts, spreadsheets, etc. they ultimately receive are PRESENTATION FORMAT outputs. The YYYY-MM-DD usage is for Data Processing Pipelines that need a stable, computationally amenable CANONICAL FORMAT. Just smile and nod a lot. No sudden movements. Assure them they’ll get a PRESENTATION FORMAT however they like. Offer a piece of fruit or something sweet. It has nothing to do with the CANONICAL FORMAT. If the ones in the trees or sitting in the grass are confused about CANONICAL vs. PRESENTATION Formats, maybe they don’t need to know too much about it – its not for them. Its for the COMPUTER. It’s for the folks that need to make it all work. Passivate them thusly and they’ll go right back to picking and eating fleas.

Date-only and date-time values are different species

A date-only value says something happened on a calendar day. A timestamp can identify a moment, provided its timezone or offset is known.

For example:

2026-10-03T14:30:00-04:00
2026-10-03T18:30:00Z

Those two strings express the same moment. Converting a timestamp into another timezone can change its displayed calendar date. That is often correct for an event log and quite wrong for a business due date that was never an instant in the first place.

Do not append a timezone to a date-only value merely to make it parseable. And do not treat an unqualified local time such as 2026-10-03 14:30 as UTC without an authoritative source rule. I mean technically, you can… but if your DATETIMES require any factual precision – DO NOT guess at this or there will be suffering. Find the answer.

PRO TIPS

  • The ‘Z’ means ZULU Time (not ‘Zone’). Its EQUIVALENT to ‘UTC’ (Universal Time Coordinated). GMT (Greenwhich Mean Time) Is Close But Not Quite. In your CSV Data Wrangling experience you won’t deal much with GMT – GMT is more or less Fuhgeddaboudit. You will see ‘Z’ and ‘UTC’. The ‘Z’ is a peculiar retained convention – convenient that its one character, but ‘conversationally’ – we’re actually talking about UTC.
  • If your Data SOURCES span different Time Zones in their date / datetime representations – you REALLY need to impose the rigor to explicitly model the ZONES.
  • “Why ZULU Time?” – you ask. Military history. Military Phonetic Alphabet. A == ‘Alpha’ … Z == ‘Zulu’. Ah, OK – It’s a ‘Z’ then… ‘Z’ for what? Its ‘Z’ for ZERO – as in ZERO TIME. Zero Time? Yup – fixed to the Prime Meridian at 0-degrees longitude. ZULU. Prime Meridian. ZERO Offset. But most days its OK to gaslight people that its got something do with that African tribe.

Decide what to do with invalid or incomplete dates

Real files also contain:

2026-02-30
TBD
00/00/0000

February 30 is impossible. TBD is likely a business placeholder. A string of zeros may be a legacy system’s missing-value marker. A blank value may be valid or unacceptable depending on the target field. Attune your eyes here to discern between “Incoming Junk” vs. “Intentional Special Signals” that happen to NOT be proper date values.

These cases should have separate policies. You might preserve a blank date in an optional column, map a specifically documented special-indicator to a blank value, and route impossible dates to an exception list. You should not silently replace all four with today’s date. You need to document your rules in the Data Dictionary you are keeping current at all times…

Similarly, a two-digit year requires an explicit century policy. Using whichever cutoff happens to be built into a library can change meanings when an old source is rerun years later. Notably, a two-digit year is non-conforming to ISO – 8601. Abide the standards.

PRO TIPS

  • Resist temptation to fudge a value, or set some default – UNLESS you really Think It Through. Treat ambiguous cases like some kind of “Anti-Memetic Micro-Bomblet”. When you HARD-SET a value you are coin-flipping DESTROYING INFORMATION. Read the bait: You Can’t Think Of A Reason Why It Might Be A Problem. That’s a noose made of excuse. Its absence of Clear And Present Danger that lets this demon feed. One Concept: CASCADE EFFECTS. Sit with that. Break it down. Learn Not To Burn.

Normalize without losing the original evidence

For business-critical data, consider keeping the source date and the normalized result during validation:

Raw value Source rule Output Assessment
03/10/2026 DMY 2026-10-03 Accepted
10/03/2026 MDY 2026-10-03 Accepted
02/30/2026 MDY — Invalid
03/10/2026 Unknown — Ambiguous

A reviewer can then see why a record was accepted or held. The final downstream CSV need not contain these audit columns, but the verification process should preserve enough information to investigate disagreement.

A repeatable date-normalization routine

  1. Identify each source’s declared date and timestamp conventions.
  2. Separate date-only fields from true timestamps.
  3. Define output formats independently for each target field.
  4. State timezone and daylight-saving interpretation where timestamps require them.
  5. Specify blank, sentinel, invalid, incomplete and ambiguous cases.
  6. Test a small collection of known examples before each new source version is admitted.
  7. Compare the total number of input records with accepted and exception records.

Where a workflow transforms recurring CSV files, encode these decisions in the reusable transformation rules rather than asking an analyst to remember them at every run. In a Model-and-Job workflow such as CSVTRAX, the useful acceptance test is not merely that a Job runs—it is that known ambiguous and invalid dates receive the intended treatment.

The practical takeaway

Reliable date normalization is the combination of correct interpretation, explicit representation and controlled exceptions. Formatting a string is the easy part. Knowing what it means—and refusing to guess when you do not—is what makes the result trustworthy.