-->
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.  [ 2 posts ] 
Author Message
 Post subject: How to store a GMT timestamp?
PostPosted: Wed Dec 13, 2006 9:52 am 
Beginner
Beginner

Joined: Fri Jan 16, 2004 11:05 am
Posts: 33
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:
3.1 and 3.2


We have a few applications where we read/write to the same tables from C++ and Java. In our C++ applications we always convert to and work with timestamps as GMT. On the Java side of things, it appears as though there is a conversion happening before it actually inserts into the database ( JDBC driver or DB itself? ).

I would expect that if I entered a value from Hibernate as a GMT that when I viewd the value with sqlplus ( for Oracle ) that the value would appear as GMT, as opposed to the local time it was entered.

In my search I have read that the default timezone of the database will effect what the time is stored as, but I have not seen any changes when changing this value. I have read mentioning of the client and or server system timezone having an effect on what the value is, and my testing seems to support this.

So, what I am really looking for clarification on is how this is supposed to work. It seems wrong to me that a timezone would only be based on the servers ( machine the jvm is running on or the DB server? ) system timezone. This value could change at any time at the whim of a OP. Also, wouldn't this mean that regardless of what you store, you are always processing by the servers timezone? And, wouldn't this mean that you are subject to DST funkiness?

Any clarification or insight on this is very appreciated.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 06, 2007 2:24 am 
Newbie

Joined: Fri Jan 12, 2007 4:39 pm
Posts: 6
Did you get a reply about your question? I have the same problem you mentioned here and am interested in a solution.

There is a solution post on the site using UserType and I am wondering if there is a simpler solution.


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

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.