I have got a spring webapp that can take in dates around the front-end. Just dates, no occasions. Then i store these dates in java
Date objects plus they finish on the mysql database inside a Date object. Initially I'd issues with the dates not aiming between your DB and also the Front-end. To start dating ? would show 12-15-2011 within the DB and display as 12-14-2011 around the Front-end. I in some way handled to repair it though and sync up (I believe I ended it from formatting using the time aspect).
Anyway, since I am moving the webapp to my server (that is apparently in GMT while my development box is within EDT) the issue has happened again. I enter to start dating ? in to the front-end as 12-15-2011 also it propogates towards the database and it is saved as 12-15-2011. Great. However after i display the item later, it's turning up as 12-14-2011. I am speculating it has something related to my machine being EDT and also the server being GMT but how do you prevent this? Among the finest the date saved, no occasions. Must i stop using
Date objects and merely stick to strings? Any help could be greatly appreciated.
Java does not have a perception of "Just Date, virtually no timeInch (JodaTime does, plain Java does not). Then when one enters to start dating ? without time, time is placed to 00:00:00.
Gradually alter learn how to set your server's time zone to yours rather.
This response is a little generic, I understand, but when it relates to TimeZone, take a look at joda-time. It might be useful.