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

DateTimeFormatter.ISO_LOCAL_DATE reverses field order

XMLWordPrintable

    • generic
    • generic
    • Verified

      ADDITIONAL SYSTEM INFORMATION :
      Dockerfile
      FROM openjdk:17-alpine

      java --version
      openjdk 17-ea 2021-09-14
      OpenJDK Runtime Environment (build 17-ea+14)
      OpenJDK 64-Bit Server VM (build 17-ea+14, mixed mode, sharing)

      A DESCRIPTION OF THE PROBLEM :
      According to specification, formatting should look like "2022-11-22", but on server machine running OpenJDK 17 (from docker image "openjdk:17-alpine") it gets formatted as "22-11-2022". This does not reproduce with other Java versions we're having locally.
      Running this code
      DateTimeFormatter dtf = DateTimeFormatter.ISO_LOCAL_DATE.withZone(ZoneId.from(ZoneOffset.UTC));
      return dtf.format(Instant.parse("2022-05-30T03:35:06Z"));


            naoto Naoto Sato
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: