[Datetime-SIG] Datetime arithmetic proposal

Alexander Belopolsky alexander.belopolsky at gmail.com
Wed Jul 29 05:17:14 CEST 2015


On Tue, Jul 28, 2015 at 10:45 PM, Tim Peters <tim.peters at gmail.com> wrote:
> But,
> internally,datetimes, dates, times, and timedeltas are all sometimes
> viewed as just complicated ways of spelling "some number of
> microseconds".

While obvious when you look from the inside of the implementation,
this is something that datetime library users will never understand.
That's why over my strong objections, timedelta grew its
total_seconds() method which is nothing else but  x /
timedeta(seconds=1).  After that, I gave up and committed
datetime.timestamp() as a shortcut for (x - EPOCH) /
timedeta(seconds=1).


More information about the Datetime-SIG mailing list