-->
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: Need help with saving timezone
PostPosted: Mon Jun 09, 2008 12:17 pm 
Newbie

Joined: Fri Jun 06, 2008 3:44 pm
Posts: 2
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: Hibernate2
DB: Oracle 10g

I am trying to save a timestamp field of the format ("mm/dd/yyyy hh:mm:ss a" ) in the Oracle DB.

Now using the HibernateUTC$CalendarType, I set the field correctly in the GMT format.

When I see the saved field in the table, the date and time field is correct ie it displays 1/1/2221 12:00:00.00 PM -05:00, but the timezone offset is wrong. It is always in the Oracle db timezone offset, which is the EST.

When I set the time/calendar, I am setting it correctly with the correct offset. But it is always saving as -5. Any help would be greatly appreciated.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 10, 2008 3:57 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
Hi,

I assume that with HibernateUTC$CalendarType you refer to this code: http://www.hibernate.org/100.html. Is this the implementation you are using?

How is the TIMESTAMP field defined? Are you creating the schema yourself using Hibernate or do you work with an existing schema. If so, Oracle has the concept of TIMESTAMP WITH TIME ZONE and TIMESTAMP WITH LOCAL TIME ZONE. Depending on your column definition you might get different results.

You might have to change the implementation of your custom UserType (HibernateUTC) to accommodate your db settings or vice versa.

--Hardy


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.