Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-11546

ValueMap.get("calendar", String.class) conversion loses timezone information

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • API 2.21.0
    • API 2.27.6
    • API
    • None

    Description

      When doing a ValueMap.get("calendar", String.class) conversion, before SLING-8116

      ISO8601.format() was used. Now, Calendar.toInstant().toString() is used. This gives a different result, because the ISO8601 gives the correct timezone, but toInstant() gives the Zulu time.

      toInstant() does the following:

      public final Instant toInstant() { return Instant.ofEpochMilli(getTimeInMillis()); }

      Timezones and offsets are completely ignored.

      Attachments

        1. image-2022-08-19-10-45-25-409.png
          137 kB
          Jelle Bouwmans
        2. image-2022-08-19-10-41-27-129.png
          154 kB
          Jelle Bouwmans

        Issue Links

          Activity

            People

              cziegeler Carsten Ziegeler
              JelleBouwmans Jelle Bouwmans
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h