报错展示:
Method call: Method format(java.time.LocalDateTime,java.lang.String) cannot be found on type org.thymeleaf.expression.Dates
解决方法:
引入依赖:
<dependency>
<groupId>org.thymeleaf.extras</groupId>
<artifactId>thymeleaf-extras-java8time</artifactId>
</dependency>
原本的代码:
<td th:text="${#dates.format(goods.startDate, 'yyyy-MM-dd HH:mm:ss')}"></td>
是用dates做处理的。
修改后:
<td th:text="${#temporals.format(goods.startDate, 'yyyy-MM-dd HH:mm:ss')}"></td>
使用temporals