-->
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: Problem with date (subtracting one day)
PostPosted: Fri May 11, 2012 1:27 pm 
Newbie

Joined: Fri May 11, 2012 1:09 pm
Posts: 1
I'm having problem with date in Hibernate.

My scenario:

I'm retrieving an entity that have an attribute Date using get method of Hibernate, like this:

Code:
Object obj = getCurrentSession().get(Object.class,
            id);


The Object in my scenario is an entity.

The hibernate runs the statement and retrieves the date with one day less. I executed the select that Hibernate generate and the date was retrieved correct.


For example:

- date in database: 01/10/2012
- date retrieved by Hibernate: 01/09/2012

Is that problem with timezone or what?

Thanks.


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.