From owner-freebsd-java Thu Jul 5 22:32:25 2001 Delivered-To: freebsd-java@freebsd.org Received: from nova.fnal.gov (nova.fnal.gov [131.225.121.207]) by hub.freebsd.org (Postfix) with ESMTP id 9004937B405 for ; Thu, 5 Jul 2001 22:32:22 -0700 (PDT) (envelope-from zingelman@fnal.gov) Received: from localhost (tez@localhost) by nova.fnal.gov (8.9.3+Sun/8.9.3) with ESMTP id AAA14802; Fri, 6 Jul 2001 00:32:15 -0500 (CDT) X-Authentication-Warning: nova.fnal.gov: tez owned process doing -bs Date: Fri, 6 Jul 2001 00:32:15 -0500 (CDT) From: Tim Zingelman X-Sender: To: Bryan Liesner Cc: Christopher Rued , Subject: Re: time screwed up with Linux-jdk1.3.1? In-Reply-To: <20010705172636.T7698-100000@adsl-151-197-8-33.phila.adsl.bellatlantic.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-java@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org If you set the environment variable TZ appropriately, the linux JDK should work as expected... ie. for US/Central time: TZ=CST6CDT export TZ - Tim p.s. I bet you a nickel this answer is in the freebsd-java email archive On Thu, 5 Jul 2001, Bryan Liesner wrote: > On Thu, 5 Jul 2001, Christopher Rued wrote: > > >Has anyone heard anything about the clock being screwed up under linux > >emulation, or in the linux-jdk1.3.1? > > > >If I run this code: > > > >public class TestTime { > > public static void main(String args[]) > > { > > System.out.println("The current time is: " > > + new java.util.Date(System.currentTimeMillis())); > > } > >} > > I did something similar in a servlet: > > SimpleDateFormat sdFormat = new SimpleDateFormat("EEEE MMMM d, yyyy HH:mm:ss z"); > String dateAndTime = sdFormat.format(new Date()); > > When Tomcat was running under linux-jdk1.3.1 it screwed up the time. > It also returned GMT-5:00 with the actual time short by an hour. > > Under the FreeBSD native jdk1.2.2, the time was returned with EDT and > the correct time. > > I haven't really looked into why. I usually use the native jdk, and I was > just playing around with the Linux jdk. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-java" in the body of the message