6 ms·
But why not use explicitly UTC datetimes? You know they're UTC. Why do you want them to be naive?
by Dylan16807 3y ago
But why not use explicitly UTC datetimes?
You know they're UTC. Why do you want them to be naive?
- aftbit 3y agoBecause the existing codebase already uses naive datetimes. For example, perhaps there is a feature flag component that includes checks like: input_dt > datetime.datetime(2023, 1, 2, 3, 4, 5) As mentioned elsewhere, it's common to serialize datatimes without timezone because it's a huge waste of space and speed in databases and elsewhere to constantly include the timezone info. Of course you could handle this at the edge like many other kinds of serialization, but many apps exist which instead choose to keep all datetimes naive and handle TZ conversions at the edge instead.