In my application I have the following 2 columns:
start - datetime
end - datetime
Corresponding java fields:
@JsonProperty
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "start")
private Calendar start;
@JsonProperty
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "end")
private Calendar end;
Whenever the front end calls the back end to persist an entity it is always saved as EST
time.
E.g. if the time is sent as 12pm
it is saved in the DB as 8am.
How can I ensure that the time saved in the DB is always in UTC
?
I tried changing the type of the start
column to be timestamp
, but this did not solve it.