简体   繁体   中英

SpringBoot JPA entity ignore timezone while save date to PostgreSQL

So, i have a table with String / Varchar column type in PostgreSQL database.

And, my spring boot entity for this column:

@Column(name = "pickup_schedule")
@Temporal(TemporalType.TIME)
private Date customPickupTm;

And then, my table saving the data of customPickupTm below:

wrong formatted time

But i only need insert to the column with format HH:mm:ss, not with +07

Any solution to remove that +07?

i'm already check & debug the final value that set to the customPickupTm variable with HH:mm:ss format

debugged variable value

Try it

@Column(name = "pickup_schedule", columnDefinition = "timestampt with time zone not null", nullable = false)
@Temporal(TemporalType.TIMESTAMP)
private Date customPickupTm;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM