Part 06 / Topic 3 of 7
Dates and time zones
03/02/2025 is the most dangerous value in the export: it parses successfully as both 2 March and 3 February. No library can resolve it, because the ambiguity is in the data, not the code. The right move is procedural, not technical: confirm the convention with the customer, record the decision, then encode it (dayfirst=False above, with the assumption stated in a comment and in the decision log you will build in Part 15).
Time zones follow the same rule. A bare 10:00:00 in a shipment feed is meaningless until the customer tells you the zone; store timestamps in UTC and convert at the edges.
🧪 Quick quiz
- The date
03/02/2025arrives. What is the right move?
Show the answer
Confirm with the customer whether it is month-first or day-first, then encode that rule. It could be 2 March or 3 February — silent guesses create wrong data that is hard to find later.
Done here? The practice set for Part 6 — 4 exercises with solutions — is on the part page.