On two seperate fresh and updated installs of fedora core 5, java always reports the wrong date. For example, the following program: public class test { public static void main(String[] args) { System.out.println(new java.util.Date()); } } When executed has the following results: [devel@adelaide1 ~]# java test Fri Jul 07 17:48:38 CST 2006 [devel@adelaide1 ~]# date Mon Jul 24 17:39:30 CST 2006 [devel@adelaide1 ~]# The time reported by date is the system time and is correct.
Hmm. This produces the correct time for me: $ gcc --version gcc (GCC) 4.1.0 20060304 (Red Hat 4.1.0-3) $ java test Mon Jul 24 17:03:12 EDT 2006 $ date Mon Jul 24 17:03:14 EDT 2006
$gcj --main=test test.java -o test $./test Sat Jul 08 10:55:59 CST 2006 Once again the incorrect date. This is reproducable on two seperate fresh installs on different machines. $ java --version java version "1.4.2" gij (GNU libgcj) version 4.1.1 20060525 (Red Hat 4.1.1-1) $ gcc --version gcc (GCC) 4.1.1 20060525 (Red Hat 4.1.1-1)
It works for me too, on my Rawhide box (4.1.1-12).
Fixing component. This is not reproducible for me either, by the way.
Can you please post the output of the 'env' command?
[root@adelaide1 ~]# env HOSTNAME=adelaide1 TERM=xterm SHELL=/bin/bash HISTSIZE=1000 SSH_CLIENT=10.0.0.201 2188 22 SSH_TTY=/dev/pts/1 USER=root LS_COLORS=no=00:fi=00:di=00;34:ln=00;36:pi=40;33:so=00;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=00;32:*.cmd=00;32:*.exe=00;32:*.com=00;32:*.btm=00;32:*.bat=00;32:*.sh=00;32:*.csh=00;32:*.tar=00;31:*.tgz=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.zip=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.bz=00;31:*.tz=00;31:*.rpm=00;31:*.cpio=00;31:*.jpg=00;35:*.gif=00;35:*.bmp=00;35:*.xbm=00;35:*.xpm=00;35:*.png=00;35:*.tif=00;35: MAIL=/var/spool/mail/root PATH=/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin INPUTRC=/etc/inputrc PWD=/root LANG=en_US.UTF-8 SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass SHLVL=1 HOME=/root LOGNAME=root SSH_CONNECTION=10.0.0.201 2188 10.0.0.243 22 LESSOPEN=|/usr/bin/lesspipe.sh %s G_BROKEN_FILENAMES=1 _=/bin/env [root@adelaide1 ~]# ./test Sat Sep 16 09:15:18 CST 2006 [root@adelaide1 ~]# date Tue Oct 3 09:06:11 CST 2006 [root@adelaide1 ~]#
It was suggested that timezone may be the issue, and it turns out that it is: $ date Tue Oct 3 23:17:50 CST 2006 $ ./test Sat Sep 16 23:27:02 CST 2006 Setting timezone to Australia/South causes this behavior. Reassigning to fitzsim.
Created attachment 138401 [details] shows the java date output on a FC5 set to IST, gcc-4.1.1-1 this problem existed in default FC5 java, and persist in updated java ie. 4.1.1-1 as shown in the output
FWIW I think this is fixed by Jakub's timezone patch. This will appear in F7.