From owner-freebsd-java Tue Mar 12 19:26: 5 2002 Delivered-To: freebsd-java@freebsd.org Received: from chen.org.nz (adsl-210.54.19.51.quicksilver.net.nz [210.54.19.51]) by hub.freebsd.org (Postfix) with ESMTP id AF9BF37B405 for ; Tue, 12 Mar 2002 19:26:01 -0800 (PST) Received: (from jonc@localhost) by chen.org.nz (8.11.6/8.11.6) id g2D3Pfq37140; Wed, 13 Mar 2002 16:25:41 +1300 (NZDT) (envelope-from jonc) Date: Wed, 13 Mar 2002 16:25:41 +1300 From: Jonathan Chen To: Timothy Kettering Cc: FreeBSD-Java Subject: Re: Setting the JVM timezone Message-ID: <20020313162541.A37054@grimoire.chen.org.nz> References: <20020312191638.A5376@fritz.cc.gt.atl.ga.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from timster@blackcore.com on Tue, Mar 12, 2002 at 06:27:03PM -0600 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 06:27:03PM -0600, Timothy Kettering wrote: [...] > But requesting the timezone in any java application I execute on the server > gets me (+600 GMT). And this makes absolutely no sense. Where is this > value coming from?? It's not CST, or even GMT. The exact output of a > simple program I included with this email (see below) is: > > The TZ is: GMT+06:00 > Well, if I read this right, it says that you're 6 hrs *West* of GMT. The UNIX convention has the '-' being East, '+' being West; New Zealand has GMT-12. I'm not too sure whether Java has adopted this convention though. [...] > Can people on this list run a simple program on their FreeBSD environment, > and see if it returns the same TZ value that their server clock is set to, > and let the list know? Thanks. I've tweaked it slightly, so that it looks like: import java.util.Date; import java.text.SimpleDateFormat; public class TestRun { public static void main(String[] args) { SimpleDateFormat formatter = new SimpleDateFormat("HH:mm zzz"); String str = formatter.format(new Date()); System.out.println("The time is: " + str); } } Output is: central-~,4:20pm> date Wed Mar 13 16:20:23 NZDT 2002 central-~,4:20pm> java TestRun The time is: 16:20 NZDT That looks correct to me, I think. -- Jonathan Chen ---------------------------------------------------------------------- "Irrationality is the square root of all evil" - Douglas Hofstadter To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-java" in the body of the message