...use Calendar from Java
Is there any common take on this problem?
Adding/Subtracting the offsets manually to convert to UTC time does not sound like the correct approach.
This is what I am trying to do.
With the database server located in NewYork, in the EST time zone.
// obj has a Calendar object with the EST time zone
dao.persist(obj);
//change the default zone to pst
TimeZone.setDefault(pst);
dao.findById(obj.getId());
returns the incorrect time(EST time instead of PST).
How to normalize time to UTC before storing in the database. Am i missing something obvious here, any help would be great help.
|