We are using PO class to represent the sql DB and using Java JPA entity.In that class, we have one column as a field currentTime
with Timestamp datatype and @version
annotation from JPA.
@Version
private Timestamp currentTime;
whenever the entity gets updated, currentTime is updated with the latest time.
currentTime = new Timestamp(0); //this will create the new timestamp with current time.
but it’s currently taking the time from the server. I want to convert this time to UTC format before saving it to DB.
Anyone can help how can I convert the time to UTC time?