发布时间:2022-08-18 18:55
spring.datasource.url=jdbc:mysql://192.168.0.201:3306/xxx?useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=GMT%2B8
设置了
serverTimezone=GMT%2B8
JdbcTemplate代码写成
map.put("list",jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(FireAlarmBean.class)));
时区不对,格式也不对。
在FireAlarmBean中修改
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")