I have a Java Date field:
Code:
private Date startDate;
Its Hibernate mapping:
Code:
<property name="startDate"/>
Generated SQL (PostGreSQL):
Code:
column start_date timestamp;
When I execute this (setting the date field from a String):
Code:
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");
Date date = dateFormat.parse("2008-10-15 10:11");
// date = Wed Oct 15 10:11:00 GMT-08:00 2008
robot.setStartDate(date);
In the database the time is wrong: 11:11 instead of 10:11. The hour gets the minutes value!
What would be the explanation?
I'm using Java 1.5, Hibernate 3 and PostGreSQL 8.