Spring 在数据库中保存ZoneDateTime而不减少小时数
我使用jhipster 5、springboot和postgres 11 我想在数据库中保存当前日期 我的当前日期是2021-05-30 22:29:50 我有这个时区:亚洲/利雅得 我使用ZoneDateTimeSpring 在数据库中保存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 数据库中数据
@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驱动程序和版本?