Send to a Friend

knight's avatar

Using Java Date class...

Asked by knight (35points) February 29th, 2008

Hi,
I want to use deprecated java date class.
When I run:

Date d1 = new Date(108,2,19); System.out.print(d1.getDate()+”/”+d1.getMonth()+”/”+d1.getYear());

I get 19/2/108. But I expect to get the year 2008 like written in
http://java.sun.com/j2se/1.4.2/docs/api/java/util/Date.html#Date(int,%20int,%20int)

My question is: how can I get the year 2008 with deprecated date class?
I mean give 108 in constructor and get 2008.

Thanks in advance Arshavski Alex.

Using Fluther

or

Using Email

Separate multiple emails with commas.
We’ll only use these emails for this message.