----------------------------------------------------------------
BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
WHEN YOU POST, include all relevant version numbers, log files,
and configuration files. Don't make us guess your problem!!!
----------------------------------------------------------------
Gangmeng Ji wrote:
> > > Hi all ( I do realize this is a Java specific problem, nothing to do
> with
> > > Jserv),
>
Yep.
> > >
> > > I have a problem with the Date (java.util.Date) on Blackdown JDK118 on
> > > Redhat Linux. I noticed a while ago someone on this list had a similar
> > > problem (but on Solaris). I checked the OS with date command line,
> which
> > > prints the correct local time. But java applications including
> _IsItWorking_
> > > print a date that is 16 hours behind. Can anyone tell me how to fix it,
> pls?
> > > There should be a workaround.
> >
> > Amazing. You post a TOTALLY off-topic problem to the list, and don't
> > include any source or give any details.
> Sorry I should have been more specific. What I have figured out is that JVM
> misinterprets time zones. What I get from the command line is " Wed Jan 5
> 11:17:07 EST 2000", which is correct. That is 11+ hours different from GMT
> in daylight savings time. However EST in this case means the Melbounre time
> zone. If I use the following code, what I get is "Tue Jan 04 19:17:44 EST
> 2000", which is the American east time, which is definitely NOT Melbourne
> time. According to what I read, the Melbourne time (Australian Estern time)
> should be coded as AET in Java. What I fail to understand is that why JVM
> can't read what is provided by the OS.
>
> Date trialTime = new Date();
> System.out.println("now: " + trialTime.toString() );
>
> What I am after is how we can configure the JVM to read the time zone
> correctly if possible.
I suggest the following course of action:
1. Read the following page:
http://java.sun.com/products/jdk/1.1/docs/api/java.util.Date.html#_top_
2. Check your system time more carefully. Linux sometimes has two different
concepts of time. Sometimes it will leave your cmos clock alone and just set up
an offset. This will probably affect the answer you get from the JDK. Remember
that 'date' and the jdk probably aren't using the same library to figure out
what the time is from the system.
3. Check the archives of this list for the answer posted previously.
4. Search on deja.com for the answer in a JAVA PROGRAMMING group. This has
nothing to do with jserv at all.
James
--
James Harman
Requisite Technology
303.474.2264
[EMAIL PROTECTED]
----------------------
For Technical Support,
email: [EMAIL PROTECTED]
phone: 303-474-2288
--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Archives and Other: <http://java.apache.org/main/mail.html>
Problems?: [EMAIL PROTECTED]