[PYTHON DB-SIG] DbiDate in DBAPI

Michael Lorton mlorton@microsoft.com
Thu, 20 Feb 1997 16:17:01 -0800


>
>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.
>[Jeff Ollie answers]
>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.
>
>A nit: better to have two functions than a non-local effect over a local
>expression.

>
>>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.
>
So "today" (i.e. 1997-02-20 00:00:00.0 - 1997-02-20 23:59:59.99 PST for
me) cannot be represented in this system?  That might be reasonable
>restriction, as many other spans of time are not representable.
>
>Conversion to/from local time should be supported for the convenience
>of humans only.
>
>Does anyone on this list qualify?
>
>M.
>

_______________
DB-SIG  - SIG on Tabular Databases in Python

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