Skip to content

DateTimeFormatter.ISO_INSTANT: Parsing fails in ThreeTenBP but not java.time.format #185

Open
@joschi

Description

org.threeten.bp.format.DateTimeFormatter.ISO_INSTANT seems to behave differently than java.time.format.DateTimeFormatter.ISO_INSTANT when parsing timestamps:

@Test
public void dateTimeFormatterIsoInstant() {
  assertNotNull(java.time.format.DateTimeFormatter.ISO_INSTANT.parse("2023-08-11T23:08:44.848+00:30"));
  assertNotNull(org.threeten.bp.format.DateTimeFormatter.ISO_INSTANT.parse("2023-08-11T23:08:44.848+00:30"));
}

Error message:

org.threeten.bp.format.DateTimeParseException: Text '2023-08-11T23:08:44.848+00:30' could not be parsed at index 23

	at org.threeten.bp.format.DateTimeFormatter.parseToBuilder(DateTimeFormatter.java:1588)
	at org.threeten.bp.format.DateTimeFormatter.parse(DateTimeFormatter.java:1416)

This seems to be related to https://bugs.openjdk.org/browse/JDK-8166138 which addressed the issue in Java 12.

The question is whether ThreeTenBP should be a backport of the Java 8 java.time classes or if these newer additions should also be covered.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions