> From: Datetime-SIG <[email protected]> on 
> behalf of Chris Barker <[email protected]>
> Sent: Wednesday, July 29, 2015 19:14
> To: Felipe Ochoa
> Cc: datetime-sig
> Subject: Re: [Datetime-SIG] Clearing up terminology
> 
> Then there seem to be the big hang-up: people want a way to define Periods 
> (as defined above) and want to be able to do datetime math with them. I"m 
> still really confused as to why folks seemed to think "time zone aware" 
> somehow meant using Peiods rather  than Durations for arithmetic, but there 
> you go. Clearly this is very useful thing to have, but it's NEW feature, and 
> not covered in the PEP.

I think you're missing something here.  This *isn't* the current behavior-- 
adding a 24 hour timedelta (a Duration) to an aware datetime (a ZonedDateTime) 
*doesn't* produce an aware datetime corresponding to the Instant 24 hours after 
the Instant corresponding to the first datetime; rather, it produces an aware 
datetime equal to the first but with its days field incremented by one.  This 
result corresponds to an Instant that may be 23 or 25 hours (or some weirder 
number, in exceptional cases) after the first Instant.  Which is to say, 
currently, datetime.timedelta behaves neither as a Period nor as a Duration.  
In order to use it as a Duration, you need to convert to UTC before doing 
arithmetic and convert back after.  *That* is what has people up in arms.

ijs

_______________________________________________
Datetime-SIG mailing list
[email protected]
https://mail.python.org/mailman/listinfo/datetime-sig
The PSF Code of Conduct applies to this mailing list: 
https://www.python.org/psf/codeofconduct/

Reply via email to