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

解决方法:

一、将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')}" 

 

posted @ 2020-07-21 18:28  天边月  阅读(724)  评论(0编辑  收藏  举报