Bug 11941 - gcj handles timezones wrongly with new Date().toString()
Summary: gcj handles timezones wrongly with new Date().toString()
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: libgcj (show other bugs)
Version: 3.3.2
: P2 normal
Target Milestone: 4.0.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
: 11248 (view as bug list)
Depends on:
Blocks: 16990
  Show dependency treegraph
 
Reported: 2003-08-16 06:44 UTC by Debian GCC Maintainers
Modified: 2005-01-30 13:45 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2004-05-20 20:33:39


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Debian GCC Maintainers 2003-08-16 06:44:04 UTC
[forwarded from http://bugs.debian.org/203212]

seen with current 3.3 CVS and HEAD.

The bug is: gij subtracts time from GMT time when it should add. Look at output
below:

##### TZ='Europe/Kaliningrad'; export TZ
##### gij Main
Mon Jul 28 13:19:15 GMT-02:00 2003
##### java Main
Mon Jul 28 18:19:22 EEST 2003
##### date
Mon Jul 28 18:19:24 EEST 2003
##### TZ='Europe/Moscow'; export TZ
##### gij Main
Mon Jul 28 12:19:33 GMT-03:00 2003
##### java Main
Mon Jul 28 19:19:37 MSD 2003
##### date
Mon Jul 28 19:19:39 MSD 2003

Moscow's timezone is GMT+3 at summer, not GMT-3.

java is Sun's Java.

##### cat Main.java
import java.util.*;
public class Main {
    public static void main(String[] args) {
        System.out.println(new Date());
    }
}
#####
Comment 1 Andrew Pinski 2003-08-16 13:10:21 UTC
*** Bug 11248 has been marked as a duplicate of this bug. ***
Comment 2 Andrew Pinski 2003-08-16 13:12:23 UTC
I can confirm this on the mainline (20030814).
Comment 3 Andrew Pinski 2003-09-28 04:04:30 UTC
Most likely fixed by <http://gcc.gnu.org/ml/java-patches/2003-q3/msg00882.html>.
Comment 4 Bryce McKinlay 2003-09-29 00:29:30 UTC
Nope, my SimpleDateFormat patch doesn't fix this - its a different problem.
Comment 5 Bryce McKinlay 2005-01-29 00:48:31 UTC
This appears to be fixed:

$ TZ='Europe/Moscow' gij TZMain
Sat Jan 29 03:46:38 GMT+03:00 2005

$ TZ='Europe/Kaliningrad' gij TZMain
Sat Jan 29 02:47:07 GMT+02:00 2005
Comment 6 Debian GCC Maintainers 2005-01-30 09:01:04 UTC
BTS masters, please set the target milestone to 4.0

Thanks, Matthias