diff options
Diffstat (limited to 'java/text/SimpleDateFormat.java')
-rw-r--r-- | java/text/SimpleDateFormat.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/java/text/SimpleDateFormat.java b/java/text/SimpleDateFormat.java index 85090f854..388043bfb 100644 --- a/java/text/SimpleDateFormat.java +++ b/java/text/SimpleDateFormat.java @@ -1096,7 +1096,10 @@ public class SimpleDateFormat extends DateFormat // exactly 2 digits. int digit_count = pos.getIndex() - index; if (digit_count == 2) - is2DigitYear = true; + { + is2DigitYear = true; + value += defaultCentury; + } } // Assign the value and move on. @@ -1107,8 +1110,7 @@ public class SimpleDateFormat extends DateFormat { // Apply the 80-20 heuristic to dermine the full year based on // defaultCenturyStart. - int year = defaultCentury + calendar.get(Calendar.YEAR); - calendar.set(Calendar.YEAR, year); + int year = calendar.get(Calendar.YEAR); if (calendar.getTime().compareTo(defaultCenturyStart) < 0) calendar.set(Calendar.YEAR, year + 100); } |