date comes up wrong..
Sohaila Roberts <[email protected]> Tue, 27 Aug 2002 10:17:37 -0230
| Newsgroups | gmane.comp.windows.devel.java.general |
|---|---|
| Message-ID | <[email protected]> |
Hi, I'm getting the date via
/* Gets the current date and returns it as a string */
private String getCurDate()
{
Calendar d = Calendar.getInstance();
Date d1 = d.getTime();
DateFormat df = DateFormat.getDateInstance();
return df.format(d1);
}
but it always thinks its a day ahead.. (like it thinks today is the 28th
but its the 27th, and the date on my server and the machine that the
applets comes up on says its the 27th also..)
why is it doing that?
I also tried
/* Gets the current date and returns it as a string */
private String getCurDate()
{
Date d1 = new date
DateFormat df = DateFormat.getDateInstance();
return df.format(d1);
}
but that gave the same result..
thanks
sohaila
You can read messages from the JAVA archive, unsubscribe from JAVA,
or subscribe to other DevelopMentor lists at http://discuss.develop.com.