[DB-SIG] Standardized Date-Time class

Hannu Krosing hannu@trust.ee
Wed, 10 Dec 1997 11:22:51 +0200


Mike Meyer wrote:

> >, adding a number to a Time may be confusing: "What am I adding?  =
> > Seconds?  Milliseconds?  Days?  Floating point?  Integer?"
>
> You don't add numbers to a time; you add times to times.  Representing
> times as a numeric quantity of some obvious unit makes it look like
> you can add numbers, but that's not really the case. However, we want
> that to be easy, so some function that has optional arguments for
> various time units and returns a time representing the number
> specified would be nice.  Have to stop with days or weeks, though, as
> months and years have variable lengths.

If it were so easy <Sigh>

If you calculate loan interest for a loan with annual interest of 12 percent, using
the 30/360 or 30/365 day year then  the difference between jan.31 and mar.31 is 60
days , when under some other circumstances it can be something completely different.

>  > >  6. Handle all dates in the Gregorian calendar.  (e.g. there should
> > >     not be problems storing dates from the 18th or 21st centuries.)
> >         As I said above, supporting non-Gregorian calendars may be made =
> > optional, but the Gregorian module should be loaded with the TimeModule, =
> > and therefore support of arbitrary Gregorian dates should be feasible.
>
> Is it going to be Gregorian all the way back, or is it going to
> convert to Julian at some point in the past? That conversion is recent
> enough to effect events of historical interest, not having happened
> until this century in some countries.

Are'nt the two actually the same until the Gregorian split?

Hannu Krosing


_______________
DB-SIG  - SIG on Tabular Databases in Python

send messages to: db-sig@python.org
administrivia to: db-sig-request@python.org
_______________