Date: Tue, 12 Mar 2002 19:16:38 -0500 From: David Dagon <dagon@cc.gatech.edu> To: Timothy Kettering <timster@blackcore.com> Cc: FreeBSD-Java <java@FreeBSD.ORG> Subject: Re: Setting the JVM timezone Message-ID: <20020312191638.A5376@fritz.cc.gt.atl.ga.us> In-Reply-To: <B8B3D2EF.5821%timster@blackcore.com>; from timster@blackcore.com on Tue, Mar 12, 2002 at 03:44:47PM -0600 References: <B8B3D2EF.5821%timster@blackcore.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020312191638.A5376>