Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
joschi opened this issue Aug 14, 2023 · 0 comments

Comments

@joschi
Copy link

joschi commented Aug 14, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant