Bug 29149 - GregorianCalendar problem with daylight-saving(?)
Summary: GregorianCalendar problem with daylight-saving(?)
Status: UNCONFIRMED
Alias: None
Product: classpath
Classification: Unclassified
Component: classpath (show other bugs)
Version: unspecified
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-20 15:58 UTC by Christian Thalinger
Modified: 2006-09-20 15:58 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Thalinger 2006-09-20 15:58:29 UTC
I found this code written by a student (stripped down to a simpler testcase):

        Date[] dates = new Date[3];
        GregorianCalendar gc = new GregorianCalendar(2005, 9, 30);

        for (int i = 0; i < 3; i++) {
            dates[i] = gc.getTime();
            gc.add(gc.DAY_OF_YEAR, 1);
        }

        for (int i = 0; i < dates.length; i++)
            System.out.println(dates[i]);

When running with RI, it prints:

$ /opt/jdk1.5.0_05/bin/java test
Sun Oct 30 00:00:00 CEST 2005
Mon Oct 31 00:00:00 CET 2005
Tue Nov 01 00:00:00 CET 2005

The same output with CACAO:

$ cacao test
Sun Oct 30 00:00:00 GMT+02:00 2005
Sun Oct 30 23:00:00 GMT+01:00 2005
Mon Oct 31 23:00:00 GMT+01:00 2005