Date: Fri, 6 Jul 2001 00:32:15 -0500 (CDT) From: Tim Zingelman <zingelman@fnal.gov> To: Bryan Liesner <bleez@bellatlantic.net> Cc: Christopher Rued <c.rued@xsb.com>, <freebsd-java@FreeBSD.ORG> Subject: Re: time screwed up with Linux-jdk1.3.1? Message-ID: <Pine.GSO.4.30.0107060026200.14766-100000@nova.fnal.gov> In-Reply-To: <20010705172636.T7698-100000@adsl-151-197-8-33.phila.adsl.bellatlantic.net>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.30.0107060026200.14766-100000>