This is the mail archive of the java-discuss@sourceware.cygnus.com mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Method getDate()



Hi Deborah,

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).

David.


On Thu, 13 Apr 2000, Deborah PISANI wrote:

> Hello,
> 
>           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?
> 
> 
> 
> Regards,
> 
> 
> 
> Deborah
> 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]