[PYTHON DB-SIG] DbiDate in DBAPI

Jeffrey C. Ollie jeff@ollie.clive.ia.us
Thu, 20 Feb 1997 14:23:10 -0600


-----BEGIN PGP SIGNED MESSAGE-----

On Thu, 20 Feb 1997 11:28:42 -0800, mlorton@microsoft.com writes:
>
>Dates in Python really should have a "precision" , the way they do in
>real life.  1996 is a date, right?  It just has a precision of one year.

Yes, a very interesting suggestion.

>There are some provocative questions:
>
>1.  What does equality mean?  Does "noon today" "equal"  1997-02-20
>12:00:00.0.  Does it equal "today"?  1997?

There should be a module-level global variable that switches between
precise matching and non-precise matching. By exact matching, I mean that
when comparing two dates, the precisions must be equal and the dates must
match within that precision. Comparisons of dates with different precisions
would raise an exception.

With non-precise matching, the date with the higher precision would be
converted to the lower precision and then the comparison would be made.

>2.  If we allow (a form of) date-equality that means inclusion, D1 == D2
> IFF ( D1 contains D2 or D2 contains D1), what about timezones?  By this
>definition 1997 in Seattle does not equal 1997 in Amsterdam, since there
>is, what, nine hours overhand on each side.
>
>3.  What about total-ordering?  Is 1997 in Amsterdam "less than" New
>Years Day  in Seattle (because it started first), "equal to" (because it
>overlaps) or "greater than" (because it ends last)?

The internal representation of a date should always be UTC. That
completely eliminates this kind of confusion.

Conversion to/from local time should be supported for the convenience
of humans only.


[A copy of the headers and the PGP signature follow.]

Date: Thu, 20 Feb 1997 14:23:10 -0600
From: "Jeffrey C. Ollie" <jeff@ollie.clive.ia.us>
In-reply-to: Your message of "Thu, 20 Feb 1997 11:28:42 PST."
             <c=US%a=_%p=msft%l=RED-45-MSG-970220192842Z-5278@INET-05-IMC.microsoft.com> 
Subject: Re: [PYTHON DB-SIG] DbiDate in DBAPI 
To: db-sig@python.org

-----BEGIN PGP SIGNATURE-----
Version: 2.6.2
Comment: AnySign 1.4 - A Python tool for PGP signing e-mail and news.

iQCVAwUBMwyyt5wkOQz8sbZFAQH5twP/btXxamurfj+DWBvhYPYPaTB6CT/jJe4Z
TBeH0zeVWc7QJj29xBtKlj5FNy9YZGZ/PM15idaWoF1UlxXKYFIKVggaeQeBDQ2X
3B81VaGDeOTGoBJ3mHm76MR9c4fDnKRgVrxb+2apgxV/QEiGWc9N76n5Stp3rPyw
QW3vzXPWaXY=
=Okba
-----END PGP SIGNATURE-----
-- 
Jeffrey C. Ollie                     |            Should Work Now (TM)
Python Hacker, Mac Lover             |

_______________
DB-SIG  - SIG on Tabular Databases in Python

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