[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Xen-devel] Time quirk, UTC on Java 5



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



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.