From owner-freebsd-java Tue Mar 12 16: 1:25 2002 Delivered-To: freebsd-java@freebsd.org Received: from fritz.cc.gt.atl.ga.us (fritz.cc.gt.atl.ga.us [199.77.128.120]) by hub.freebsd.org (Postfix) with ESMTP id A99E337B405 for ; Tue, 12 Mar 2002 16:01:22 -0800 (PST) Received: (from dagon@localhost) by fritz.cc.gt.atl.ga.us (8.11.6/8.11.6) id g2D0Gck05434; Tue, 12 Mar 2002 19:16:38 -0500 (EST) (envelope-from dagon) Date: Tue, 12 Mar 2002 19:16:38 -0500 From: David Dagon To: Timothy Kettering Cc: FreeBSD-Java Subject: Re: Setting the JVM timezone Message-ID: <20020312191638.A5376@fritz.cc.gt.atl.ga.us> References: Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.2.5i In-Reply-To: ; from timster@blackcore.com on Tue, Mar 12, 2002 at 03:44:47PM -0600 X-Echelon: RSA Crypto C4 Mossad CIA BXA Export Control Hello to all the fans of the US Patriot Act 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 On Tue, Mar 12, 2002 at 03:44:47PM -0600, Timothy Kettering wrote: > > I brought this up before, but I didnšt really get an satisfactory > answer/explaination, so I'm bringing it up again. I missed your previous question/answer, and might repeat old information. What was lacking? > Can anyone help me figure out how to adjust the JVM to use the correct > timezone values. I know I can code in fixes for the timezone and all that > in my programs, but its still rather irksome that I can't write up quick > programs for my own use without having to put in a whole lot of code to > compenstate for the 12 hour wackiness. If I recall from the 1.1 days, the system property "user.timezone", is loaded on startup. You can set an environment variable to force this to a reasonable value. For a while, the fallback for no "user.timezone", TimeZone.getDefault().getID(), was PST (North Am. Pacific--Sun's backyard). Now I think it's GMT, or something more wordly, cultured and sophisticated. (I've not checked.) There was a little debate over whether this was a bug or not. So, perhaps check 'date "+%Z"' (for bash), and see if this property is being consulted. Also, I recall that there was some issue with certain caledar objects not having the same default TZ. That is, some/most would get GMT, but a few would have PST for a default. This was years ago, and perhaps this has been addressed. Still, it might be that your code interacts with this. In terms of fixing this, you might just make a static setSaneTZ(String) method, and drop this in your scratch/utility package for future use. One line, and your time components are all on the same time zone. :) Cheers, -- David Dagon dagon@cc.gatech.edu Georgia Institute of Technology To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-java" in the body of the message