I saw several threads related to the problem that I have, but I could not figure out how to solve my problem,
I have an attribute in an Entity of type Date. I liked this definition,
@Column(name="CREATION_DATETIME") @Temporal(TemporalType.TIMESTAMP) private Date creationDateTime
When I print the date value, it is in the local time zone, which is acceptable because toString () in Date uses the default time zone; which will be the time zone in which the program runs. when saving to the database, it saves the value of the local time zone; but I want it to be kept the original value without any change in time zone. Here is Hibernate. why is this happening and how can this be solved?
Below is an example to make my problem clear. Date 2011-11-30T19: 02: 00 + 0000 is stored as 30-NOV-11 01.02.00.000000000 PM. the local time zone is CST, so it has a value of -0600 and saves it.
thank you sanjay
source share