Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Internal date format (numerical)

Re: Internal date format (numerical)

From: Mark Bole <makbo_at_pacbell.net>
Date: Sat, 03 Dec 2005 01:01:37 GMT
Message-ID: <R76kf.35356$6e1.4890@newssvr14.news.prodigy.com>


DA Morgan wrote:
> Turkbear wrote:
>

>>> Normally, there is little reason to use the DATE datatype. [...]

Several add-on comments, last one first:

  1. 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.
  2. 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.
  3. 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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US