Uploaded image for project: 'OpenDJ'
  1. OpenDJ
  2. OPENDJ-7948

Backport OPENDJ-7882: Rest2Ldap truncates zero seconds from ISO 8601 format date time values

    XMLWordPrintable

    Details

    • Bug
    • Status: Done
    • Blocker
    • Resolution: Fixed
    • 6.5.0
    • 2021.1
    • rest

      Description

      The switch to using JDK8's new date / time APIs caused a minor change in behavior in Rest2Ldap which may cause problems in some client applications. In particular, timestamps expressed using LDAP's generalized time syntax are converted to ISO 8601 using java.time.OffsetDateTime#toString which has the following documented behavior:

      Outputs this date-time as a String, such as 2007-12-03T10:15:30+01:00.
      
      The output will be one of the following ISO-8601 formats:
      * uuuu-MM-dd'T'HH:mmXXXXX
      * uuuu-MM-dd'T'HH:mm:ssXXXXX
      * uuuu-MM-dd'T'HH:mm:ss.SSSXXXXX
      * uuuu-MM-dd'T'HH:mm:ss.SSSSSSXXXXX
      * uuuu-MM-dd'T'HH:mm:ss.SSSSSSSSSXXXXX
      
      The format used will be the shortest that outputs the full value of the time where the omitted parts are implied to be zero.
      

      Unfortunately some clients cannot parse the truncated format. In addition, it has been suggested that we should generate a string representation that can be reliably compared, but that's only possible if the timezone is normalized to UTC and trailing nano-seconds are always included. I don't think we should do that since the conversion is losing information (the original time zone) - clients should take care to compare values properly.

      CC/ Andi Egloff and Darinder Shokar

      Acceptance criteria: this issue can be closed once the generated ISO 8601 string no longer truncates the seconds field.

        Attachments

          Issue Links

            Activity

              People

              JnRouvignac Jean-Noël Rouvignac
              JnRouvignac Jean-Noël Rouvignac
              Matthew Swift Matthew Swift
              carole forel carole forel
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: