Bug 199902

Summary: Java reports incorrect date
Product: [Fedora] Fedora Reporter: Chris Parsons <chrisp>
Component: gccAssignee: Thomas Fitzsimmons <fitzsim>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 5CC: tromey
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-03-08 20:01:16 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
shows the java date output on a FC5 set to IST, gcc-4.1.1-1 none

Description Chris Parsons 2006-07-24 07:48:42 UTC
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.

Comment 1 Andrew Overholt 2006-07-24 20:54:42 UTC
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

Comment 2 Chris Parsons 2006-07-25 01:00:50 UTC
$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)

Comment 3 Thomas Fitzsimmons 2006-07-25 13:29:49 UTC
It works for me too, on my Rawhide box (4.1.1-12).


Comment 4 Deepak Bhole 2006-10-02 16:14:18 UTC
Fixing component. This is not reproducible for me either, by the way. 

Comment 5 Deepak Bhole 2006-10-02 17:30:07 UTC
Can you please post the output of the 'env' command?

Comment 6 Chris Parsons 2006-10-02 23:20:03 UTC
[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 ~]#

Comment 7 Deepak Bhole 2006-10-03 13:51:29 UTC
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.

Comment 8 Amit Tewari 2006-10-13 04:48:24 UTC
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

Comment 9 Tom Tromey 2007-03-08 19:47:12 UTC
FWIW I think this is fixed by Jakub's timezone patch.
This will appear in F7.