From owner-freebsd-java Wed Apr 26 14: 5:39 2000 Delivered-To: freebsd-java@freebsd.org Received: from firewall.ox.com (firewall.ox.com [129.77.1.1]) by hub.freebsd.org (Postfix) with ESMTP id BB06337BA4F for ; Wed, 26 Apr 2000 14:05:32 -0700 (PDT) (envelope-from rcf@ox.com) Received: from firewall.ox.com (root@localhost) by firewall.ox.com with ESMTP id RAA08626 for ; Wed, 26 Apr 2000 17:05:31 -0400 (EDT) Received: from pur-wk-rfurphy.ny.ox.com (pur-wk-rfurphy.ny.ox.com [129.77.2.133]) by firewall.ox.com with ESMTP id RAA08620 for ; Wed, 26 Apr 2000 17:05:30 -0400 (EDT) Received: from ox.com (localhost.ny.ox.com [127.0.0.1]) by pur-wk-rfurphy.ny.ox.com (8.9.3/8.9.3) with ESMTP id RAA06816; Wed, 26 Apr 2000 17:05:30 -0400 (EDT) (envelope-from rcf@ox.com) Message-ID: <39075A1A.70DBE0F1@ox.com> Date: Wed, 26 Apr 2000 17:05:30 -0400 From: Rob Furphy X-Mailer: Mozilla 4.7 [en] (X11; I; FreeBSD 3.4-RELEASE i386) X-Accept-Language: en MIME-Version: 1.0 To: freebsd-java@freebsd.org, glewis@trc.adelaide.edu.au Subject: *BETTER* Pre-alpha JDK 1.2.2 TimeZone (time) bug fix References: <39061716.2E69B654@ox.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-java@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org 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