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

Bad date(year) formating: Output is 30-12-2020 instead of 30-12-2019

XMLWordPrintable

    • x86_64
    • generic

      A DESCRIPTION OF THE PROBLEM :
              System.out.println(System.getProperty("java.version"));
              // 1.8.0_40
              DateTimeFormatter readDormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
              LocalDate date = LocalDate.parse("2019-12-30", readDormatter);
              DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-YYYY");
              System.out.println(formatter.format(date));
              //output: 30-12-2020


            kravikumar Kiran Sidhartha Ravikumar (Inactive)
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: