原因是数据库使用了非中国时区,因为mybatis会读取数据库市区来转换时间戳。
解决办法:
修改连接字符串,加上参数:
jdbc:mysql://192.168.1.130:3306/xxxxx?characterEncoding=utf-8&useSSL=false&useTimezone=true&serverTimezone=GMT%2B8
原因是数据库使用了非中国时区,因为mybatis会读取数据库市区来转换时间戳。
解决办法:
修改连接字符串,加上参数:
jdbc:mysql://192.168.1.130:3306/xxxxx?characterEncoding=utf-8&useSSL=false&useTimezone=true&serverTimezone=GMT%2B8