by hafthor · 7y ago · 0 comments
new java.text.SimpleDateFormat("YYYY-MM-dd").parse("2018-12-30") returns Sun Dec 31 2017
new java.text.SimpleDateFormat("YYYY-MM-dd").format(new java.util.Date("12/30/2018")) returns 2019-12-30
java.time from Java8 also affected.
java.time.format.DateTimeFormatter.ofPattern("YYYY-MM-dd").format(java.time.LocalDate.parse("2018-12-30")) returns 2019-12-30
https://docs.oracle.com/javase/1.5.0/docs/api/java/text/Simp...
I've never seen YYYY used in Java.