--- old/src/java.base/share/classes/java/time/format/DateTimeFormatter.java 2016-02-11 22:53:04.177293001 +0300 +++ new/src/java.base/share/classes/java/time/format/DateTimeFormatter.java 2016-02-11 22:53:03.895293001 +0300 @@ -923,6 +923,7 @@ *
@@ -935,6 +936,7 @@ ISO_OFFSET_DATE_TIME = new DateTimeFormatterBuilder() .parseCaseInsensitive() .append(ISO_LOCAL_DATE_TIME) + .parseLenient() .appendOffsetId() .toFormatter(ResolverStyle.STRICT, IsoChronology.INSTANCE); } @@ -1160,6 +1162,7 @@ *
@@ -1178,6 +1181,7 @@ .appendValue(MONTH_OF_YEAR, 2) .appendValue(DAY_OF_MONTH, 2) .optionalStart() + .parseLenient() .appendOffset("+HHMMss", "Z") .toFormatter(ResolverStyle.STRICT, IsoChronology.INSTANCE); } --- old/src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java 2016-02-11 22:53:04.983293001 +0300 +++ new/src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java 2016-02-11 22:53:04.693293001 +0300 @@ -866,7 +866,8 @@ * Appends the zone offset, such as '+01:00', to the formatter. *
* This appends an instruction to format/parse the offset ID to the builder. - * This is equivalent to calling {@code appendOffset("+HH:MM:ss", "Z")}. + * If in lenient parsing mode, this is equivalent to calling {@code appendOffset("+HH:mm:ss", "Z")}. + * Otherwise this is equivalent to calling {@code appendOffset("+HH:MM:ss", "Z")}. * * @return this, for chaining, not null */ @@ -888,7 +889,8 @@ *
* During parsing, the offset is parsed using the format defined below. * If the offset cannot be parsed then an exception is thrown unless the - * section of the formatter is optional. + * section of the formatter is optional. In lenient parsing mode, the minutes + * are optional in the patterns +HHMMss and +HH:MM:ss. *
* The format of the offset is controlled by a pattern which must be one * of the following: @@ -902,6 +904,10 @@ *