I\'m storing JodaTime DateTime
field to timestamptz
column by using org.jadira.usertype:usertype.jodatime:1.9
. App server has +4 time
Ok. I have spend 8 hours to solve the problem. If your are using usertype project to persist JodaTime, you have to set databaseZone
property of PersistentDateTime
class equals to current application server timezone (not database!).
But it's better to use official hibernate support. It solves the problem out of the box because it uses java.utl.Date
to persist DateTime
and java.util.Date
correctly persisted by default