Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2016625 | 1.2.0 | John Oconner | P3 | Closed | Fixed | 1.2beta4 |
Received from jdk-comments:
Date: Wed, 20 Aug 1997 13:34:16 -0600
From: Jack Barnard <###@###.###>
Organization: Lucent Technologies
X-Mailer: Mozilla 4.01 [en] (WinNT; I)
To: ###@###.###
Subject: Year 2000 (Y2K) problem
X-Priority: 3 (Normal)
Hi,
The SimpleDateFormat in JDK1.1 does not support year 2000.
When I enter 1/1/00 it gives me 01-Jan-1900 back!
--
Jack Barnard
Lucent Technologies
Distinguished MTS
###@###.###
(303)538-3976
this seemed a little odd but the following program exhibits the
behaviour:
class dateyy {
public static void main(String[] args) {
SimpleDateFormat formatter = new SimpleDateFormat ("yy.mm.dd");
ParsePosition pos = new ParsePosition(0);
Date currentTime_2 = formatter.parse("00.1.1", pos);
formatter = new SimpleDateFormat ("yyyy.mm.dd");
String datestring = formatter.format(currentTime_2);
System.out.println(datestring);
}
}
which gives
1900.1.1
maybe it shouldn't default to 1900 but give back 0000.1.1 I don't
know what this would break.
The provided testcase is not completed. Missing import statement. Need to addimport java.text.*; verify at jdk116e, fixed
Date: Wed, 20 Aug 1997 13:34:16 -0600
From: Jack Barnard <###@###.###>
Organization: Lucent Technologies
X-Mailer: Mozilla 4.01 [en] (WinNT; I)
To: ###@###.###
Subject: Year 2000 (Y2K) problem
X-Priority: 3 (Normal)
Hi,
The SimpleDateFormat in JDK1.1 does not support year 2000.
When I enter 1/1/00 it gives me 01-Jan-1900 back!
--
Jack Barnard
Lucent Technologies
Distinguished MTS
###@###.###
(303)538-3976
this seemed a little odd but the following program exhibits the
behaviour:
class dateyy {
public static void main(String[] args) {
SimpleDateFormat formatter = new SimpleDateFormat ("yy.mm.dd");
ParsePosition pos = new ParsePosition(0);
Date currentTime_2 = formatter.parse("00.1.1", pos);
formatter = new SimpleDateFormat ("yyyy.mm.dd");
String datestring = formatter.format(currentTime_2);
System.out.println(datestring);
}
}
which gives
1900.1.1
maybe it shouldn't default to 1900 but give back 0000.1.1 I don't
know what this would break.
The provided testcase is not completed. Missing import statement. Need to addimport java.text.*; verify at jdk116e, fixed
- backported by
-
JDK-2016625 parsing 1/1/00 gives back 1900
- Closed
- duplicates
-
JDK-4086114 DateFormat parses 2/29/00 as 2/29/1900
- Closed
- relates to
-
JDK-4180453 SimpleDateFormat("MM/dd/yyyy") parses 10/28/98 but will not parse 10/28/00
- Closed