-
Bug
-
Resolution: Fixed
-
P3
-
1.1.5, 1.2.0, 1.2.1, 1.3.1_22
-
007
-
generic, x86
-
generic, windows_95, windows_nt, windows_xp, windows_2008, windows_vista
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2159160 | 1.3.1 | Masayoshi Okutsu | P4 | Closed | Cannot Reproduce | |
JDK-2025019 | 1.2.2 | Alan Liu | P3 | Resolved | Fixed | 1.2.2 |
JDK-2025018 | 1.2.1_003 | Alan Liu | P3 | Resolved | Fixed | b03 |
JDK-2025017 | 1.1.8 | Alan Liu | P3 | Resolved | Fixed | 1.1.8 |
JDK-2025016 | 1.1.7 | Alan Liu | P3 | Resolved | Fixed | 005 |
Name: gsC80088 Date: 02/05/99
SimpleDateFormat does not correctly consider leap years in the
following code. This only occurs in jdk1.2. It works correctly
on 1.1.6
import java.lang.*;
import java.util.*;
import java.text.*;
public class testdate
{
public testdate()
{
}
public static void main(String[] arg)
{
SimpleDateFormat format = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");
format.setLenient(false);
try
{
String normal = "03/13/1998 12:22:43";
String leap2000 = "02/29/2000 13:40:22";
String leap1996 = "02/29/1996 08:15:15";
System.out.println("Normal date:");
Date dnorm = format.parse(normal);
System.out.println(dnorm);
System.out.println("2000 date:");
Date d2000 = format.parse(leap2000);
System.out.println(d2000);
System.out.println("1996 date:");
Date d1996 = format.parse(leap1996);
System.out.println(d1996);
}
catch(ParseException pe)
{
System.out.println(pe);
}
catch(Exception e)
{
System.out.println(e);
}
}
}
output from 1.2:
Normal date:
Fri Mar 13 12:22:43 EST 1998
2000 date:
java.text.ParseException: Unparseable date: "02/29/2000 13:40:22"
output from 1.1.6:
Normal date:
Fri Mar 13 12:22:43 EST 1998
2000 date:
Tue Feb 29 13:40:22 EST 2000
1996 date:
Thu Feb 29 08:15:15 EST 1996
(Review ID: 53564)
======================================================================
- backported by
-
JDK-2025016 Regression: SimpleDateFormat w/lenient mode false, throws exception for Feb 29
- Resolved
-
JDK-2025017 Regression: SimpleDateFormat w/lenient mode false, throws exception for Feb 29
- Resolved
-
JDK-2025018 Regression: SimpleDateFormat w/lenient mode false, throws exception for Feb 29
- Resolved
-
JDK-2025019 Regression: SimpleDateFormat w/lenient mode false, throws exception for Feb 29
- Resolved
-
JDK-2159160 Regression: SimpleDateFormat w/lenient mode false, throws exception for Feb 29
- Closed
- duplicates
-
JDK-4210209 DateFormat does not parse Feb 29 2000
- Closed
-
JDK-4228369 Bug parsing Feb. 29, 2000?
- Closed
-
JDK-4246972 Unparseable date in SimpleDateFormat Feb, 29
- Closed
- relates to
-
JDK-4388292 PST timezone now appears as GMT -08:00 on Linux 122_007
- Closed