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

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

    Details

    • Subcomponent:
    • Introduced In Version:
      8
    • Resolved In Build:
      b130
    • CPU:
      generic
    • OS:
      generic

      Description

      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.

        Activity

        dsurber Douglas Surber created issue -
        rriggs Roger Riggs made changes -
        Field Original Value New Value
        Fix Version/s 9 [ 14949 ]
        rriggs Roger Riggs made changes -
        Assignee Roger Riggs [ rriggs ]
        rriggs Roger Riggs made changes -
        Status New [ 10000 ] Open [ 1 ]
        rriggs Roger Riggs made changes -
        Assignee Roger Riggs [ rriggs ] Nadeesh Tv [ ntv ]
        ntv Nadeesh Tv (Inactive) made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Understanding Cause Known [ 10000 ]
        ntv Nadeesh Tv (Inactive) made changes -
        Labels jdk9-fc-request
        mr Mark Reinhold made changes -
        Summary java.time.format.DateTimeFormatter cannot parse an offset with single digit hour. java.time.format.DateTimeFormatter cannot parse an offset with single digit hour
        briangoetz Brian Goetz made changes -
        Labels jdk9-fc-request jdk9-fc-request jdk9-fc-yes
        hgupdate HG Updates made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Resolved In Build team [ 17324 ]
        Understanding Cause Known [ 10000 ]
        Resolution Fixed [ 1 ]
        hgupdate HG Updates made changes -
        Resolved In Build team [ 17324 ] master [ 18256 ]
        hgupdate HG Updates made changes -
        Resolved In Build master [ 18256 ] b130 [ 17604 ]
        iris Iris Clark made changes -
        Labels jdk9-fc-request jdk9-fc-yes jdk9-fc-request jdk9-fc-yes jsr379-annex2-tbd
        iris Iris Clark made changes -
        Labels jdk9-fc-request jdk9-fc-yes jsr379-annex2-tbd jdk9-fc-request jdk9-fc-yes jsr379-annex1
        darcy Joe Darcy made changes -
        Link This issue csr of CCC-8066806 [ CCC-8066806 ]

          People

          • Assignee:
            ntv Nadeesh Tv (Inactive)
            Reporter:
            dsurber Douglas Surber
          • Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: