> Please watch the following code:
> (Though the constructor Date(int year, int month, int date) was
> deprecated)
> Note that I am creating a date object for the date 1 July 2006.
...
> The output is
> String representation of current date:Wed Aug 01 00:00:00 IST 3906
>
> Am I wrong?
Yes. Note the instructions in the documentation for the
"three ints" form of the constructor.
<http://java.sun.com/j2se/1.5.0/docs/api/java/util/Date.html#Date(int,%20int,%20int)>
>...What may be the problem?
Note also, that constructor is deprecated.
> How to create Date instance for desired date?
Try reading the rest of that document.
Andrew T.
Andrew Thompson - 12 Sep 2006 07:12 GMT
> > Please watch the following code:
> > (Though the constructor Date(int year, int month, int date) was
> > deprecated)
....
> Note also, that constructor is deprecated.
Oh. ....Ooops!
Arne Vajhøj - 12 Sep 2006 22:16 GMT
>> The output is
>> String representation of current date:Wed Aug 01 00:00:00 IST 3906
[quoted text clipped - 4 lines]
> "three ints" form of the constructor.
> <http://java.sun.com/j2se/1.5.0/docs/api/java/util/Date.html#Date(int,%20int,%20int)>
Specifically:
year - the year minus 1900.
(2006+1900=3906)
Arne