The following test fails: a '86
birthday is formated as 2068
. How can I format is as 1986
?
@Test
public void testBirthday() {
assertEquals("1986-08-07", java.time.LocalDate.parse("070886",
java.time.format.DateTimeFormatter.ofPattern("ddMMyy")));
}
Fails with:
java.lang.AssertionError: expected:<1986-08-07> but was:<2086-08-07>
This is much different to org.joda.time
library which would correctly assume 19'
here.
/Sidenote: regarding the marked answers in the "duplicate" questions, I don't think this is a duplicate!