pep proposal : A date object for the standard library

Greg Ewing greg at cosc.canterbury.ac.nz
Thu Dec 6 19:22:10 EST 2001


sebastien wrote:
> 
> I feel this solution better than the POSIX convention to count the
> elapsed time in seconds because not all the days have the same length.

What?!? This sounds more like an argument for NOT using days as
the basic unit. Otherwise you can't meaningfully take the difference
between two dates and express it in the same units.

> We can define a few numbers of constants:
>     seconds =      1.0
>     minutes =     60.0
>     hours   =   3600.0
>     days    =  86400.0
>     weeks   = 604800.0
> 
> We can't introduce higher constants because we deal here with absolute
> duration. Length of month or year isn't absolute but relative to the
> starting date.

Because of what you said above about leap seconds, the same
thing applies to days and weeks, too! Although I'll concede
that for most purposes the difference won't matter.

-- 
Greg Ewing, Computer Science Dept, University of Canterbury,	  
Christchurch, New Zealand
To get my email address, please visit my web page:	  
http://www.cosc.canterbury.ac.nz/~greg



More information about the Python-list mailing list