Re: date comes up wrong..
Sohaila Roberts <[email protected]> Tue, 27 Aug 2002 12:30:41 -0230
| Newsgroups | gmane.comp.windows.devel.java.general |
|---|---|
| Message-ID | <[email protected]> |
The date on the client machine is the correct date..
I'm using jdk 1.3.1_03-b03 and redhat 7.2
On Tue, 27 Aug 2002, David Rosenstrauch wrote:
> Calendar.getInstance() will give you a calendar set to the current
> date/time of the client machine. So if the date is wrong I would think it
> has to be because the system date/time is wrong.
>
> Which JDK & OS are you using?
>
>
> DR
>
>
> At 10:17 AM 8/27/2002 -02-30, you wrote:
> >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.
>
You can read messages from the JAVA archive, unsubscribe from JAVA,
or subscribe to other DevelopMentor lists at http://discuss.develop.com.