Thymeleaf 日期格式问题
2020-12-22 本文已影响0人
ppstar
问题
编辑页面,日期格式展示不正确

解决办法
使用#dates进行格式化
th:value="${#dates.format(emergencyInfo.outTime, 'yyyy-MM-dd HH:mm:ss')}"
或
th:text="${#dates.format(emergencyInfo.outTime, 'yyyy-MM-dd HH:mm:ss')}"
编辑页面,日期格式展示不正确
使用#dates进行格式化
th:value="${#dates.format(emergencyInfo.outTime, 'yyyy-MM-dd HH:mm:ss')}"
或
th:text="${#dates.format(emergencyInfo.outTime, 'yyyy-MM-dd HH:mm:ss')}"