JakeWharton / ThreeTenABP

An adaptation of the JSR-310 backport for Android.
Apache License 2.0
3.55k stars 133 forks source link

Bug in DateTimeFormatter - Wrong year. #130

Closed AriMeidan closed 3 years ago

AriMeidan commented 3 years ago

Log for before and after using the format: DateTimeFormatter.ofPattern("dd-MM-YY - HH:mm:ss");

2020-12-27 17:41:58.504 D/MainActivity: updateTime: 2020-12-27T17:41:58.501 2020-12-27 17:41:58.514 D/MainActivity: updateTimeFormatted: 27-12-21 - 17:41:58

sayler666 commented 3 years ago

Use yy instead of YY. https://dev.to/shane/yyyy-vs-yyyy-the-day-the-java-date-formatter-hurt-my-brain-4527