From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ted Kaczmarek Subject: RE: Time quirk, UTC on Java 5 Date: Mon, 07 Nov 2005 13:18:49 -0500 Message-ID: <1131387529.3407.11.camel@pluto.linsolutions.com> References: Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7BIT Return-path: In-reply-to: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Ian Pratt Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On Sat, 2005-10-29 at 15:26 +0100, Ian Pratt wrote: > > I have been testing java 5 on some apps and I always see utc > > timezone for the logging when running these on a xen guest. > > All the regular logging timestamps are fine, only the java > > ones are showing up as UTC. > > Same setup on a non xen kernel on the same box the timestamps > > are fine. > > Truly bizzare. The only thing I can think of is if it tries to run > /sbin/hwclock or access /dev/rtc directly. You could try strace'ing it. > > Ian Finally got back to this :-) xen_changeset : Sun Nov 6 13:50:33 2005 +0100 7628:270469d40f02 dom0 and domU are Centos 4.2 with java version "1.5.0_05" installed. Test java code import java.util.Date; import java.util.TimeZone; public class TimeTest { public static void main(String args[]) { long time = System.currentTimeMillis(); String millis = Long.toString(time); Date date = new Date(time); System.out.println("Current time in milliseconds = " + millis + " => " + date.toString()); System.out.println("Current time zone: " + TimeZone.getDefault().getID()); } } On dom0 returns EST which is local timezone. On domU returns GMT. I didn't see rtc or hwclock accesed or used in any of the strace output. http://paste.ubuntulinux.nl/4185 Nice python script I stumbled across. http://ubuntu.wordpress.com/2005/09/12/script-to-post-terminal-output-to-pastebin/ Regards, Ted