Other |
---|
1.3.1_14 b01Fixed |
Duplicate :
|
|
Duplicate :
|
|
Duplicate :
|
|
Relates :
|
Name: wm7046 Date: 04/13/2004 The following testcase fails in JDK 1.3.1_11 only. It might be a regression. import java.text.SimpleDateFormat; import java.util.Date; SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd"); sdf.setLenient(false); Date d1 = sdf.parse("2004.04.02"); Date d2 = sdf.parse("2004.04.06"); System.out.println("A date value in PST zone:" + d1.toString()); System.out.println("A date value in PDT zone:" + d2.toString()); OR @ To make the test complete: @ . @ SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); @ sdf2.setLenient(false); @ String s1 = sdf2.format(d1); @ String s2 = sdf2.format(d2); @ System.out.println("Canonical version of d1:" + s1); @ System.out.println("Canonical version of d2:" + s2); @ . @ Above test case will return "2004/04/02 00:00:00" for d1, and @ "2004/04/06 01:00:00" for d2. @ Ideally, both conversions should return 00:00:00 as the time component. (Incident Review ID: 249946) ====================================================================== ###@###.### 10/11/04 18:36 GMT
|