Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/postgresql/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring 在数据库中保存ZoneDateTime而不减少小时数_Spring_Postgresql - Fatal编程技术网

Spring 在数据库中保存ZoneDateTime而不减少小时数

Spring 在数据库中保存ZoneDateTime而不减少小时数,spring,postgresql,Spring,Postgresql,我使用jhipster 5、springboot和postgres 11 我想在数据库中保存当前日期 我的当前日期是2021-05-30 22:29:50 我有这个时区:亚洲/利雅得 我使用ZoneDateTime @Column(name = "startdate_jc") private ZonedDateTime startdateJc; 数据库中的列类型为: startdate_jc timestamp without time zone 数据库中数据

我使用jhipster 5、springboot和postgres 11

我想在数据库中保存当前日期

我的当前日期是2021-05-30 22:29:50

我有这个时区:亚洲/利雅得

我使用ZoneDateTime

 @Column(name = "startdate_jc")
    private ZonedDateTime startdateJc;
数据库中的列类型为:

 startdate_jc timestamp without time zone
数据库中数据的问题是:2021-05-30 19:29:50.697

因此减少了3个小时

在postgresql.conf中,我有:时区='亚洲/科威特'

我想保存当前日期而不减少任何时间

我试图在application.yml中更改此配置,但未成功:

  jpa:
        open-in-view: false
        properties:
            hibernate.jdbc.time_zone: UTC+03
此外,我还尝试使用LocalDateTime

需要更多信息(请添加答案作为问题的更新):1)在
psql
显示时区的内容返回?2) 再次在
psql
中选择“2021-05-30 22:29:50”:时间戳返回?3) 什么JDBC驱动程序和版本?