springboot data jdbc 数据库日期和查询出来的结果不一致

时间:2020-07-21 22:34:12   收藏:0   阅读:96

解决方法:

一、将serverTimezone=UTC改为CTT

 url: jdbc:mysql://localhost:3306/moviechoicesystem?serverTimezone=CTT&useUnicode=true&characterEncoding=utf-8&useSSL=false

二、使用thymeleaf遍历的时候,格式化一下。

th:text="${#dates.format(mm.create_time,‘yyyy-MM-dd HH:mm‘)}" 

 

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!