Loading

日期格式化(thymeleaf、SpringBoot、mybatis-plus场景...)

Thymeleaf日期格式化

<td th:text="${#dates.format(entity.createTime, 'yyyy-MM-dd HH:mm:ss')}"></td>

SpringBoot+Mybatis-Plus 日期格式化

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") // JSON格式 响应给浏览器
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") // 接收
    private Date createDate;
posted @ 2021-08-17 16:09  JereCode  阅读(425)  评论(0编辑  收藏  举报