Java LocalDate Formatting of 2000-1-2 error [duplicate]
问题 This question already has answers here : Java string to date conversion (13 answers) SimpleDateFormat incorrectly rolling year forward during format of Date [duplicate] (2 answers) Closed last year . 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