Why does datetime.timedelta only have the attributes 'days' and 'seconds'?

Jon Ribbens jon+usenet at unequivocal.eu
Tue Apr 19 17:36:57 EDT 2022


On 2022-04-19, Barry <barry at barrys-emacs.org> wrote:
>> On 19 Apr 2022, at 19:38, Dennis Lee Bieber <wlfraed at ix.netcom.com> wrote:
>> *    I /think/ this is the year used for leap-day calculations, and
>>      why some leap centuries are skipped as it is really less than a
>>      quarter day per year, so eventually one gets to over-correcting
>>      by a day.
>
> Leap century is skip unless it’s a leap quadra century.

Indeed, which is why "leap=not year & 3" works for years in
range(1901, 2100). Which I have found useful before when
programming in an assembly language that has no division
operation ;-)


More information about the Python-list mailing list