by philipn on 8/21/15, 1:05 AM with 35 comments
by kbenson on 8/21/15, 7:24 AM
In every case where I've seen this problem, it's a matter of people either not storing the timezone along with the local time, or not storing in UTC time. A local time with a timezone is a unique time, it does not occur twice. A UTC time additionally does not occur twice. Store a time zone along with the date and time or store in UTC and convert on use.
Note: If there are instances where a second is repeated, it's rare special occurrence that developing a formalized interface for seems like overkill.
by toyg on 8/21/15, 8:57 AM
Dealing with time adjustments is the OS's job, not userland. If your job has to be scheduled exactly and cannot rely on the OS, and you refuse to deal with UTC, it's your own damn fault and you can always just use a long-running process with timers.
by lifeisstillgood on 8/21/15, 7:26 AM
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
by Marazan on 8/21/15, 10:01 AM
by IanCal on 8/21/15, 6:00 AM
> In these situations, the information displayed on a local clock (or stored in a Python datetime instance) is insufficient to identify a particular moment in time.
Does the datetime instance not store the timezone?
by mayoff on 8/21/15, 11:39 PM
https://developer.apple.com/library/mac/documentation/Cocoa/...