Bug 199902 - Java reports incorrect date
Java reports incorrect date
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: gcc (Show other bugs)
5
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Thomas Fitzsimmons
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-07-24 03:48 EDT by Chris Parsons
Modified: 2007-11-30 17:11 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-03-08 15:01:16 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
shows the java date output on a FC5 set to IST, gcc-4.1.1-1 (129.10 KB, image/jpeg)
2006-10-13 00:48 EDT, Amit Tewari
no flags Details

  None (edit)
Description Chris Parsons 2006-07-24 03:48:42 EDT
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 16:54:42 EDT
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-24 21:00:50 EDT
$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 09:29:49 EDT
It works for me too, on my Rawhide box (4.1.1-12).
Comment 4 Deepak Bhole 2006-10-02 12:14:18 EDT
Fixing component. This is not reproducible for me either, by the way. 
Comment 5 Deepak Bhole 2006-10-02 13:30:07 EDT
Can you please post the output of the 'env' command?
Comment 6 Chris Parsons 2006-10-02 19:20:03 EDT
[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 09:51:29 EDT
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 00:48:24 EDT
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 14:47:12 EST
FWIW I think this is fixed by Jakub's timezone patch.
This will appear in F7.

Note You need to log in before you can comment on or make changes to this bug.