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

Dates are being formatted incorrectly for 26th December 2021 and above.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • None
    • 8u212
    • core-libs
    • generic
    • os_x

      A DESCRIPTION OF THE PROBLEM :
      Wrong year is being printed when getting date in requested format.

      REGRESSION : Last worked in version 8u212

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      System.out.println(
            ZonedDateTime.of(2021, 12, 26, 0, 0, 0, 0, ZoneId.of("Europe/London")).format(DateTimeFormatter.ofPattern("d MMMM YYYY"))
          );

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      26 December 2021
      ACTUAL -
      26 December 2022

      ---------- BEGIN SOURCE ----------
      System.out.println(
            ZonedDateTime.of(2021, 12, 26, 0, 0, 0, 0, ZoneId.of("Europe/London")).format(DateTimeFormatter.ofPattern("d MMMM YYYY"))
          );
      ---------- END SOURCE ----------

      FREQUENCY : always


            psonal Pallavi Sonal (Inactive)
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: