Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

12/31/9999 a valid Java Date?

1,058 views
Skip to first unread message

Randall J. Parr

unread,
Mar 18, 1999, 3:00:00 AM3/18/99
to
I'm trying to determine limits there are on the Java Date and/or
Calendar type.

Specifically, I'm trying to determine what to use as the "beginning of
time" and the "end of time" in my Oracle database, which is accessed by
Java applications.

I'm trying to constrain some "from" and "thru" date columns to be NOT
NULL and to default to "the beginning of time" or "the end of time".
This set up makes it very intuitive to ask "is TODAY between FromDt and
ThruDt" without having to handle the vagaries of using NULL in either
column.

I have determined that Oracle is happy to have me use "12/31/9999" as
"the end of time".

Now I'm trying to determine if Java (JDBC) will let me retrieve/store
these dates and use them in my Java processing.

Thanks

R.Parr
Temporal Arts

Greg Hinton

unread,
Mar 18, 1999, 3:00:00 AM3/18/99
to rp...@temporal.com
"Randall J. Parr" wrote:
>
> I'm trying to determine limits there are on the Java Date and/or
> Calendar type.

The date represented by
new Date(Long.MAX_VALUE)
is Sun Aug 17 00:12:55 PDT 292278994.

Yes, Java does have a Y292279K bug.

Paul Hill

unread,
Mar 19, 1999, 3:00:00 AM3/19/99
to Randall J. Parr

I figure they won't be able to blame me in more than
a quarter of trillion (.25 x 10^9) years!

For more information about java.util.Date and its relatives see
"Computer Dating" in the FAQ.

The lowest value for some operations (i.e. setting with
day, month, year in a Calendar and I believe creating a string with DateFormat)
was limited to 4713 BC prior to JDK 1.2 (and late 1.1.* releases
that _post_ date 1.2), but you could create an earlier binary date
that was/is comparable.

You might see if Oracle will allow 99999.

Hope that helps,
-Paul
--
Java FAQ: http://www.afu.com/javafaq.html

jimbo

unread,
Mar 20, 1999, 3:00:00 AM3/20/99
to
~ Y300M bug !

:)

0 new messages