This is the mail archive of the
mailing list for the Java project.
Re: Method getDate()
- To: Deborah PISANI <Deborah dot PISANI at st dot com>
- Subject: Re: Method getDate()
- From: David Pettersson <dapet at mai dot liu dot se>
- Date: Thu, 13 Apr 2000 10:09:31 +0200 (MET DST)
- cc: java-discuss at sourceware dot cygnus dot com
I guess this is not the right group for the question, this group
is about gnu java ...
The constructor Date(int,int,int) is deprecated in from version 1.1 of
JDK. It should be replaced by the method set in the Calender class.
Se "http://java.sun.com/products/jdk/1.2/docs/api/index.html" for more
info. (According to this site year 2000 in Date(int,int,int) should be
represented as 100, since 2000-1900=100).
On Thu, 13 Apr 2000, Deborah PISANI wrote:
> We are using JKD 1.1.6 software on a Linux operating system. I have
> been trying to get the current time using the method getDate() in the Date
> class of the java.util. However, this is always returning the date January 1,
> 1970, 00:00:00 GMT. The constructor for getDate (int, int, int) which accepts
> a value for the year, month and day functions only correctly when the year is
> given by the last two digits and is smaller or equal to 99. When I tried 00
> for year 2000, it again returned the day and time of the epoch. A four-digit
> year (eg. 1999) is not accepted.
> Any suggestions of how this problem was solved using preferably this
> version of the software?