-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: normalizing timestamps to UTC: store in the database
PostPosted: Mon Mar 19, 2007 2:37 am 
Newbie

Joined: Mon Mar 19, 2007 2:12 am
Posts: 1
...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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.