public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgcj/18087] New: Calendar's HOUR field gets adjusted when setting DAY_OF_MONTH field.
@ 2004-10-20 18:54 mnefedov at rogers dot com
2004-10-20 19:01 ` [Bug libgcj/18087] " pinskia at gcc dot gnu dot org
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: mnefedov at rogers dot com @ 2004-10-20 18:54 UTC (permalink / raw)
To: java-prs
Calendar's HOUR field gets adjusted when setting DAY_OF_MONTH field -- it
should not be adjusted.
Here is a sample code.
import java.util.Calendar;
import java.text.SimpleDateFormat;
public class CalendarTest2 {
public static void main( String [] args ) {
boolean fail = false;
Calendar c = Calendar.getInstance();
SimpleDateFormat df = new SimpleDateFormat( "EEEEEEEEEEEEE,
yyyy-MM-dd [DDD] HH:mm:ss.SSSS" );
System.out.println( "Today: " + df.format( c.getTime() ) );
c.set( 2004, 9, 1, 12, 0, 0 );
c.set( Calendar.MILLISECOND, 0 );
System.out.println( df.format( c.getTime() ) );
c.set( Calendar.DAY_OF_MONTH, 2 );
System.out.println( df.format( c.getTime() ) );
c.set( Calendar.DAY_OF_MONTH, 3 );
System.out.println( df.format( c.getTime() ) );
c.set( Calendar.DAY_OF_MONTH, 4 );
System.out.println( df.format( c.getTime() ) );
}
}
Here is the output with the errors:
1: Today: Wednesday, 2004-10-20 [294] 13:51:47.0592
2: Friday, 2004-10-01 [275] 13:00:00.0000
3: Saturday, 2004-10-02 [276] 13:00:00.0000
4: Sunday, 2004-10-03 [277] 12:00:00.0000
5: Monday, 2004-10-04 [278] 12:00:00.0000
Error #1: line 2: hour was set to 12 not 13. What is interesting in this
case -- c.get( Calendar.HOUR ) will give 12 back. SimpleDateFormat() report 13
though.
Error #2: line 4: hour is 12 now.
--
Summary: Calendar's HOUR field gets adjusted when setting
DAY_OF_MONTH field.
Product: gcc
Version: 3.4.2
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: libgcj
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: mnefedov at rogers dot com
CC: gcc-bugs at gcc dot gnu dot org,java-prs at gcc dot gnu
dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18087
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug libgcj/18087] Calendar's HOUR field gets adjusted when setting DAY_OF_MONTH field.
2004-10-20 18:54 [Bug libgcj/18087] New: Calendar's HOUR field gets adjusted when setting DAY_OF_MONTH field mnefedov at rogers dot com
@ 2004-10-20 19:01 ` pinskia at gcc dot gnu dot org
2004-10-20 19:05 ` pinskia at gcc dot gnu dot org
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-20 19:01 UTC (permalink / raw)
To: java-prs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-10-20 19:00 -------
Confirmed on the mainline.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Known to fail| |4.0.0
Last reconfirmed|0000-00-00 00:00:00 |2004-10-20 19:00:50
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18087
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug libgcj/18087] Calendar's HOUR field gets adjusted when setting DAY_OF_MONTH field.
2004-10-20 18:54 [Bug libgcj/18087] New: Calendar's HOUR field gets adjusted when setting DAY_OF_MONTH field mnefedov at rogers dot com
2004-10-20 19:01 ` [Bug libgcj/18087] " pinskia at gcc dot gnu dot org
@ 2004-10-20 19:05 ` pinskia at gcc dot gnu dot org
2004-10-20 19:07 ` mckinlay at redhat dot com
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-20 19:05 UTC (permalink / raw)
To: java-prs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-10-20 19:05 -------
*** Bug 18088 has been marked as a duplicate of this bug. ***
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18087
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug libgcj/18087] Calendar's HOUR field gets adjusted when setting DAY_OF_MONTH field.
2004-10-20 18:54 [Bug libgcj/18087] New: Calendar's HOUR field gets adjusted when setting DAY_OF_MONTH field mnefedov at rogers dot com
2004-10-20 19:01 ` [Bug libgcj/18087] " pinskia at gcc dot gnu dot org
2004-10-20 19:05 ` pinskia at gcc dot gnu dot org
@ 2004-10-20 19:07 ` mckinlay at redhat dot com
2004-10-20 19:13 ` pinskia at gcc dot gnu dot org
2004-10-20 19:36 ` mckinlay at redhat dot com
4 siblings, 0 replies; 6+ messages in thread
From: mckinlay at redhat dot com @ 2004-10-20 19:07 UTC (permalink / raw)
To: java-prs
------- Additional Comments From mckinlay at redhat dot com 2004-10-20 19:07 -------
?? Pinskia: are you sure? This should be fixed already on mainline. Here's the
output I get with 4.0.0 20041019:
$ gij CalendarTest2
Today: Wednesday, 2004-10-20 [294] 15:05:28.0425
Friday, 2004-10-01 [275] 12:00:00.0000
Saturday, 2004-10-02 [276] 12:00:00.0000
Sunday, 2004-10-03 [277] 12:00:00.0000
Monday, 2004-10-04 [278] 12:00:00.0000
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18087
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug libgcj/18087] Calendar's HOUR field gets adjusted when setting DAY_OF_MONTH field.
2004-10-20 18:54 [Bug libgcj/18087] New: Calendar's HOUR field gets adjusted when setting DAY_OF_MONTH field mnefedov at rogers dot com
` (2 preceding siblings ...)
2004-10-20 19:07 ` mckinlay at redhat dot com
@ 2004-10-20 19:13 ` pinskia at gcc dot gnu dot org
2004-10-20 19:36 ` mckinlay at redhat dot com
4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-20 19:13 UTC (permalink / raw)
To: java-prs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-10-20 19:13 -------
Oh, you are right, what throw me off is the printing of todays date. This is fixed on the mainline.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
Target Milestone|--- |4.0.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18087
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug libgcj/18087] Calendar's HOUR field gets adjusted when setting DAY_OF_MONTH field.
2004-10-20 18:54 [Bug libgcj/18087] New: Calendar's HOUR field gets adjusted when setting DAY_OF_MONTH field mnefedov at rogers dot com
` (3 preceding siblings ...)
2004-10-20 19:13 ` pinskia at gcc dot gnu dot org
@ 2004-10-20 19:36 ` mckinlay at redhat dot com
4 siblings, 0 replies; 6+ messages in thread
From: mckinlay at redhat dot com @ 2004-10-20 19:36 UTC (permalink / raw)
To: java-prs
------- Additional Comments From mckinlay at redhat dot com 2004-10-20 19:36 -------
I've added a regression test based on this test case, to mauve's
gnu.testlet.java.util.Calendar.set
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18087
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2004-10-20 19:36 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-20 18:54 [Bug libgcj/18087] New: Calendar's HOUR field gets adjusted when setting DAY_OF_MONTH field mnefedov at rogers dot com
2004-10-20 19:01 ` [Bug libgcj/18087] " pinskia at gcc dot gnu dot org
2004-10-20 19:05 ` pinskia at gcc dot gnu dot org
2004-10-20 19:07 ` mckinlay at redhat dot com
2004-10-20 19:13 ` pinskia at gcc dot gnu dot org
2004-10-20 19:36 ` mckinlay at redhat dot com
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).