Skip to content

Comment on Python Enhancement Proposal 495: Local Time Disambiguation

Comments

So :

Time in UK is currently UTC +1 (BST) At 2am on 25 OCT we will return to GMT / UTC. It will therefore become 1am, and for the next hour all times will have happened before

The idea is to put a bit flag that says "alreadyseenthistime"

It seems to me this is a solution to the wrong problem.

Store all strings as bytes, assuming UTF-8, store all times as longs assuming UTC

If we convert all python datelines to non-naive (ie embedded with a TZ) then we are forced always to choose an encoding just like in strings. The right encoding is to always assume incoming dates are UTC, to throw error if they are non naive, and to assume that local clocks are set correctly (which we do anyway)

I need to read it more carefully - but it seems the wrong solution

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.