Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8066806

java.time.format.DateTimeFormatter cannot parse an offset with single digit hour

XMLWordPrintable

    • 8
    • b130
    • generic
    • generic

      There's no way to parse a single digit hour in the offset. Example:

        2011-01-20 02:55:07.532941 -8:00

      The spec needs to be modified to cover this case and the code enhanced to support it.

      The only workaround is to parse the date/time separately, use a hand coded parser for the offset and combine the LocalDateTime with the hand parsed offset. Not an easy work around.

      I have run across some occurrences of this though I can't say how common it is.

            ntv Nadeesh Tv
            dsurber Douglas Surber
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: