Java LocalDate Formatting of 2000-1-2 error [duplicate]
This question already has an answer here: Java string to date conversion 13 answers SimpleDateFormat incorrectly rolling year forward during format of Date [duplicate] 2 answers Today some tests on a new build machine failed, where on other machines thes where ok. Looking after the problem it shows that @Test public void testDateTimeFormater() { String result = LocalDate.of(2000,1,2) .format(DateTimeFormatter.ofPattern("YYYY-MM-dd")); Assert.assertTrue(result,result.equals("2000-01-02")); } Results in 'java.lang.AssertionError: 1999-01-02' The jave version not working is root@build02:~# java