-----Original Message----- From: Ernie McCracken [mailto:holycrap@cavtel.net] Sent: Friday, October 29, 2004 06:21 PM To: fedora-list@redhat.com Subject: Re: java time
On Fri, Oct 29, 2004 at 10:06:48PM +0400, Vano Beridze wrote:
if I run a command date it gives me the output Fri Oct 29 22:03:50 GEST 2004
but If I compile and run a simple java program (with jdk1.4.2 or jdk1.5)
it gives me the output Fri Oct 29 23:03:50 GEST 2004
Is it just me, or are the output of both the "date" command and the java program exactly the same? :-)
Close, but no cigar ;-) The hours are different by 1 (22 hundred hours vs. 23 hundred hours). I would check to see if the daylight savings time settings are the reason. With a difference of only one hour, it seems like a strange but possible culprit. Just a thought.
-Mike
Mike Markiw III wrote:
Is it just me, or are the output of both the "date" command and the java program exactly the same? :-)
Close, but no cigar ;-) The hours are different by 1 (22 hundred hours vs. 23 hundred hours). I would check to see if the daylight savings time settings are the reason. With a difference of only one hour, it seems like a strange but possible culprit. Just a thought.
-Mike
My shell date command indicates that it is in DST.
Try it on Monday and see what happens. Daylight savings time will be over. :)
Robin Laing wrote:
Mike Markiw III wrote:
Is it just me, or are the output of both the "date" command and the java program exactly the same? :-)
Close, but no cigar ;-) The hours are different by 1 (22 hundred hours vs. 23 hundred hours). I would check to see if the daylight savings time settings are the reason. With a difference of only one hour, it seems like a strange but possible culprit. Just a thought.
-Mike
My shell date command indicates that it is in DST.
Try it on Monday and see what happens. Daylight savings time will be over. :)
But his timezone was GEST in both cases. I'm not familiar with that timezone. Does it have DST? Does it end when the USA's ends?
Kevin J. Cummings wrote:
But his timezone was GEST in both cases. I'm not familiar with that timezone. Does it have DST? Does it end when the USA's ends?
The timezone I use is simple GMT+4. It's called Asia/Tbilisi.
I don't know how things work but today my time was set back to one hour automatically. but java still reports time that is one hour ahead. As I said before it might not be a jdk bug because It works ok on fedora core 1. Maybe a combination of 2.6 kernel and jdk. Just thoughts.
Thanks
Vano Beridze wrote:
I don't know how things work but today my time was set back to one hour automatically. but java still reports time that is one hour ahead. As I said before it might not be a jdk bug because It works ok on fedora core 1. Maybe a combination of 2.6 kernel and jdk. Just thoughts.
Works for me:
[andrei@brie andrei]$ cat A.java public class A { public static void main(String[] args) { System.out.println(new java.util.Date()); } } [andrei@brie andrei]$ javac A.java [andrei@brie andrei]$ java A Mon Nov 01 13:43:20 EET 2004 [andrei@brie andrei]$ date Mon Nov 1 13:43:23 EET 2004 [andrei@brie andrei]$ which javac /usr/java/j2sdk1.4.2_04/bin/javac [andrei@brie andrei]$ which java /usr/java/j2sdk1.4.2_04/bin/java [andrei@brie andrei]$ java -version java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) [andrei@brie andrei]$ uname -a Linux brie.mine.nu 2.6.8-1.521 #1 Mon Aug 16 09:01:18 EDT 2004 i686 athlon i386 GNU/Linux [andrei@brie andrei]$ cat /etc/redhat-release Fedora Core release 2 (Tettnang) [andrei@brie andrei]$
j2sdk1.4.2 works fine on kernel 2.6.8 (which was the combination you reported). Maybe one of the systems is wrong about the GEST offset.
//Andro