<dependency>
<groupId>org.thymeleaf.extras</groupId>
<artifactId>thymeleaf-extras-java8time</artifactId>
<version>${thymeleaf-extras-java8time.version}</version>
</dependency>
首先我們需要引入上面的包,因java8中時間類型與之前版本不一致
在轉換中應該採用temporals來做格式化
<td th:text="${#temporals.format(userRelation.updateTime,'yyyy-MM-dd HH:mm:ss')}"></td>