Closed jamesdbaker closed 5 years ago
I have a LocalDate object. If this is set to 2019-12-30 or 2019-12-31, then the following formatting shows the incorrect date (notice the year):
2019-12-30
2019-12-31
<p th:text="${#temporals.format(event.deadline, 'dd MMM YYYY')}"></p>
Gives 30 Dec 2020 and 31 Dec 2021 respectively. The adjacent dates give 29 Dec 2019 and 01 Jan 2020 as expected.
30 Dec 2020
31 Dec 2021
29 Dec 2019
01 Jan 2020
I am using Spring Boot 1.5.22.RELEASE, which uses thymeleaf-extras-java8time 2.1.0.RELEASE.
I think you should use yyyy for the year pattern instead of YYYY, please see https://stackoverflow.com/questions/8686331/y-returns-2012-while-y-returns-2011-in-simpledateformat
I have a LocalDate object. If this is set to
2019-12-30
or2019-12-31
, then the following formatting shows the incorrect date (notice the year):Gives
30 Dec 2020
and31 Dec 2021
respectively. The adjacent dates give29 Dec 2019
and01 Jan 2020
as expected.I am using Spring Boot 1.5.22.RELEASE, which uses thymeleaf-extras-java8time 2.1.0.RELEASE.