1、mysql

字段名称    类型
begin_time  TIME

begin_time=08:18:39

2、java数据库连接串

jdbc:mysql://x.x.x.x:3306/y?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false

3、java获取begin_time值

22:18:39

原因:时区问题导致。

解决:

连接串中加入:&serverTimezone=GMT%2B8,即可。完整如下:

jdbc:mysql://x.x.x.x:3306/y?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8

 

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2019-07-05
  • 2021-06-28
  • 2021-11-13
  • 2021-07-05
  • 2021-11-14
猜你喜欢
  • 1970-01-01
  • 2021-09-05
  • 2022-02-20
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案