Jun 12th, 2011, 04:52 PM
Incorrect dates and times being saved and returned from jsp's
I'm having a problem with my JSP/ Spring MVC application I've developed. Whenever I save and load dates or times using the @Temporal(TemporalType.DATE) and @DateTimeFormat(pattern="dd-MM-yyyy") or the @Temporal(TemporalType.TIME) @DateTimeFormat(pattern="HH:mm") annotations, the dates and times are written and displayed incorrectly.
What's happening is the date is saving correctly but when I attempt to edit the date, it is being displayed minus 1 day. When I attempt to save a time two hours are being added to the time.
When I test the application locally everything works fine but when I deploy it to my production (hosted) tomcat server I begin to see the incorrect dates and times. This leads me to believe it may be locale specific but I cannot be sure.
I'm using Spring 3.0.5 and Hibernate. I'm not using any initbinder or jodatime. Can anyone suggest any reason why this may be happening?
Thanks in advance
Tags for this Thread