[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freebsd-java
Subject:    *BETTER* Pre-alpha JDK 1.2.2 TimeZone (time) bug fix
From:       Rob Furphy <rcf () ox ! com>
Date:       2000-04-26 21:05:30
[Download RAW message or body]

Hello all,

In my fix from yesterday although the wall clock time was correct, the
timezone
was incorrect and the JVM was defaulting to a generic timezone which set
the
jvm's clock to the best guess of what a 'wall clock' would say the time
was.

Needless to say this eventually fails if you ever cross a daylight savings
time boundry
while the jvm is running.

I have a better code fix now which I think will work for all cases and give
the
correct time and timezone.  I now get the correct time and the timezone is
"America/New_York" as I expect.

Could everyone else please try this new change to see if it works in your
timezone?


My informal way to get this into the next patchset is here:

in src/freebsd/native/java/lang/java_props_md.c at line 283 you'll find

#ifdef __FreeBSD__ /*** XXX ***/
        hasDST = local_tm->tm_isdst;
        offset = local_tm->tm_gmtoff;
#else
        hasDST = daylight == 0 ? kStandard : kDaylight;
        offset = timezone / -60; /* Conventions reversed between UNIX &
Java */
#endif


change this to:

#ifdef __FreeBSD__ /*** XXX ***/

        hasDST = (local_tm->tm_isdst == 0) ? kStandard :
kDaylight;                            /*** changed  line ***/
        offset = (local_tm->tm_gmtoff / 60) - (local_tm->tm_isdst == 0 ? 0
: 60);      /*** re-changed line ***/

#else
        hasDST = daylight == 0 ? kStandard : kDaylight;
        offset = timezone / -60; /* Conventions reversed between UNIX &
Java */
#endif


Rob F



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-java" in the body of the message


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic