Skip to content

8364752: Class java.time.Instant cannot parse all ISO 8601 date formats #26708

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

naotoj
Copy link
Member

@naotoj naotoj commented Aug 8, 2025

Instant.parse() is expected to use the offset zone pattern +HH:mm:ss (as defined by DateTimeFormatterBuilder.appendOffsetId()), but it fails to parse hour-only offsets such as +02. This is because the actual implementation uses +HH:MM:ss as the pattern. While replacing the pattern in the implementation as with the specification would allow hour-only offsets, it would also introduce compatibility issues, i.e., printing would omit the minutes field when it is zero. So, it is preferable to update the specification to match the implementation. A CSR has also been drafted for this change.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change requires CSR request JDK-8365182 to be approved

Issues

  • JDK-8364752: Class java.time.Instant cannot parse all ISO 8601 date formats (Bug - P3)
  • JDK-8365182: Class java.time.Instant cannot parse all ISO 8601 date formats (CSR)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/26708/head:pull/26708
$ git checkout pull/26708

Update a local copy of the PR:
$ git checkout pull/26708
$ git pull https://git.openjdk.org/jdk.git pull/26708/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 26708

View PR using the GUI difftool:
$ git pr show -t 26708

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/26708.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Aug 8, 2025

👋 Welcome back naoto! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Aug 8, 2025

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk
Copy link

openjdk bot commented Aug 8, 2025

@naotoj The following labels will be automatically applied to this pull request:

  • core-libs
  • i18n

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added core-libs [email protected] i18n [email protected] rfr Pull request is ready for review labels Aug 8, 2025
@naotoj naotoj changed the title 8365182: Class java.time.Instant cannot parse all ISO 8601 date formats 8364752: Class java.time.Instant cannot parse all ISO 8601 date formats Aug 8, 2025
@openjdk openjdk bot added the csr Pull request needs approved CSR before integration label Aug 8, 2025
@mlbridge
Copy link

mlbridge bot commented Aug 8, 2025

Webrevs

@ExE-Boss
Copy link

ExE-Boss commented Aug 9, 2025

How about using different patterns for parsing and printing instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core-libs [email protected] csr Pull request needs approved CSR before integration i18n [email protected] rfr Pull request is ready for review
Development

Successfully merging this pull request may close these issues.

2 participants