problem with java.util.Date
i've a small problem in this program ... date, hours, minutes & seconds are displayed correct, but month & year are displayed incorrect ... could u plz solve this problem
import java.util.*;
class Test
{
public static void main(String args[])
{
Date date=new java.util.Date();
int dd,mm,yy,hh,mi,ss;
String rightNow=null;
dd=date.getDate();
mm=date.getMonth();
yy=date.getYear();
hh=date.getHours();
mi=date.getMinutes();
ss=date.getSeconds();
rightNow=dd+"/"+mm+"/"+yy+" "+hh+":"+mi+":"+ss;
System.out.println(rightNow);
}
}
i'll wait 4 a good reply
|