Handling time correctly.
WHY IT IS DIFFICULT
Time zones, formats, and the difference between a date and a moment.
WHAT PYTHON PROVIDES
Types for dates, times, combined values, and durations.
WHAT TO BE CLEAR ABOUT
Whether a value carries a time zone.
A value without one is ambiguous, and mixing the two causes errors.
WHAT TO PREFER FOR ANYTHING STORED
Values carrying a time zone, or an explicit convention applied everywhere.
WHAT TO STORE
A consistent standard internally, converting for display.
WHY
Converting at the edges and storing consistently prevents a large class of bugs.
PARSING TEXT INTO DATES
Explicit, with the format specified.
Never rely on guessing.
FORMATTING FOR DISPLAY
Also explicit.
WHAT TO BE CAREFUL WITH
Day and month order, which differs by region Daylight changes, where they apply Arithmetic across time zone boundaries
WHAT DURATIONS ARE FOR
Differences between times, and adding or subtracting periods.
WHAT TO VALIDATE
That parsed dates are plausible.