[DB-SIG] ODMG Date/time classes

M.-A. Lemburg lemburg@uni-duesseldorf.de
Thu, 18 Dec 1997 12:13:15 +0100


Jim Fulton wrote:
> 
> As promised, I'm providing skeleton python classes that
> describe the interfaces to the standard date-time related
> types defined by the Object Data Management Group (ODMG)
> standard.  I beleave these are based on possibly SQL standards,
> although I can't provide a reference.
> 
> I prefer this interface to the interface proposed by M.-A. Lemburg
> because:
> 
>   - It is a standard,
> 
>   - It handles time zones in a reasonable minimal manner,
> 
>   - It provides for separation of date, time, and interval,
> 
>   - It supports date/time arithmetic,
> 
>   - It provides information hiding (the implementation is not
>     exposed)
> 

I can't see that many differences between what you're exposing
there and what I'm currently doing. You could very well use
my DateTime-type as internal basis for all your classes, since
nearly all features you have provided skeletons for are already
available as methods or instance variables. Some things are still
missing, like hashing, comparing, etc. but they'll be added
soon.

I left the timezone and DST out on purpose, since I feel
that a simple enough type can easily be extended in any
particular way.

The date/time arithmetic will be in one of the next versions,
once I find some time to code them up. It looks like you are
only providing absolute time differences, is that correct ?
I'm asking because I still haven't decided yet on introducing
one or two types for intervalls -- maybe the absolute one in C
and the relative one in Python (since there are dozens of different
way these can be implemented).

Together with your suggested C object wrapping of the C API
it is a piece of cake to adapt any DB interface to use the
type -- that's why I coded it up in C after all. BTW, that
wrapping method is really ingenious, you should promote that
more often :-)

-- 
Marc-Andre Lemburg



_______________
DB-SIG  - SIG on Tabular Databases in Python

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