DA Morgan wrote:
> Turkbear wrote:
>
>>> Normally, there is little reason to use the DATE datatype.
[...]
Several add-on comments, last one first:
- I think what Daniel is saying, ever since version 9i it's better to
use the TIMESTAMP datatype, since it is an extension of the DATE
datatype with more functionality. Of course, so much existing code,
including OCI, works with DATE that it won't be going away anytime soon.
But if you are starting from scratch, use TIMESTAMP.
- Leap seconds -- in a database, they don't really need to be accounted
for. Most servers are synch'ed at the OS level to various known good
time sources, and those time sources handle skipping of the leap second,
so SYSDATE should always provide a valid time. I suppose there is the
problem of someone recording some event as happening at a time
corresponding to a second that is skipped, but since leap seconds are
not calculated according to a formula as leap years are, it's hard to
see how they could be algorithmically included in a list of known
invalid time periods both past and future.
- The most important point is that Oracle does NOT calculate dates by
counting days from a base point (contrary to the repeated guesses of the
OP). Suppose I ask you about something that happened 14,369 days ago --
just think of the work you have to do to figure out year, month, and
day. Oracle calculates centuries by counting from a base point (year 0)
via the excess-100 notation, but the other components are not calculated
against a fixed base point. Intuitively, this seems to me a better way
to support indexing and various date manipulations -- gee, it's almost
like an object type!
-Mark Bole
Received on Fri Dec 02 2005 - 19:01:37 CST