[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: java.util.Date mess
From: |
Jeroen Frijters |
Subject: |
RE: java.util.Date mess |
Date: |
Mon, 11 Oct 2004 17:29:52 +0200 |
Ka-Hing Cheung wrote:
> On Mon, 2004-10-11 at 15:39 +0200, Jeroen Frijters wrote:
> > I have some code that depends on unspecified behavior of
> java.util.Date.
> > In the Sun JDK if you pass out of range parameters to the Date
> > constructors that take year, month, date, etc. it will automatically
> > convert to a valid date (for example, new Date(104, 8, 41)
> is Oct 11,
> > 2004.)
>
> Is that unspecified? The javadoc says:
>
> "In all cases, arguments given to methods for these purposes need not
> fall within the indicated ranges; for example, a date may be specified
> as January 32 and is interpreted as meaning February 1."
Thanks, I had overlooked that part at the top. The individual methods
all say:
Parameters:
year - the year minus 1900.
month - the month between 0-11.
date - the day of the month between 1-31
So I assumed that these were the only valid inputs.
Regards,
Jeroen