以下总结了使用Thymeleaf做项目过程中碰到的有价值的知识点。拿出来分享!
1.格式化日期
<span th:text="'发布时间:'+${#dates.format(post.getPostTime(),'yyyy-MM-dd HH:mm')}">2019年05月12日 00:16</span>
<span th:text="'发布时间:'+${#dates.format(post.getPostTime(),'yyyy-MM-dd HH:mm')}">2019年05月12日 00:16</span>