[Python-Dev] Status on PEP-431 Timezones

Mark Lawrence breamoreboy at yahoo.co.uk
Tue Jul 28 13:55:38 CEST 2015


On 28/07/2015 03:15, Tim Peters wrote:
> [Mark Lawrence <breamoreboy at yahoo.co.uk>]
>> To me a day is precisely 24 hours, no more, no less.  I have no interest in
>> messing about with daylight savings of 30 minutes, one hour, two hours or
>> any other variant that I've not heard about.
>>
>> In my mission critical code, which I use to predict my cashflow, I use code
>> such as.
>>
>> timedelta(days=14)
>>
>> Is somebody now going to tell me that this isn't actually two weeks?
>
> Precisely define what "two weeks" means, and then someone can answer.

One week == 7 days == 7 * 24 hours
Two weeks = 2 * (one week)

>
> The timedelta in question represents precisely 14 24-hours days, and
> ignores the possibility that some day in there may suffer a leap
> second.

As I've said elsewhere I've no interest in DST, at least right here, 
right now, let alone leap seconds. When I run my cashflow forecast the 
balance in my bank account one year from today isn't going to be 
influenced by UK clocks falling back to GMT at the end of October and on 
to BST at the end of next March.

>
> It remains unclear to me which of those outcomes _you_ consider to be
> "actually 14 days".  But my bet is that you like what Python already
> does here (because "tz-naive arithmetic" is exactly what _I_ want in
> all my financial code).
>

Correct.  What I would like to know is how many people are in my 
position, how many people are in the situation of needing every possible 
combination of dates, times, daylight saving, local time zone rules and 
anything else you can think of under the sun, and how many are on the 
scale somewhere in between these two extremes.

-- 
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence



More information about the Python-Dev mailing list