I am working on an application that stores conferences with start and end dates. So far, I have developed in Belgium, and my server is in France, so everything is in the same time zone, no problem. But today I am in San Francisco, my server is in France, and I noticed that I have an error.
I set the dates from the Flex client (ActionScript automatically adapts the date display according to the local time zone of the client, which for me today is GMT-8. My server works in Hibernate and MySQL in France (GMT + 1). I look at my database, using phpMyAdmin, I see the date set to "2010-06-07 00:00:01", but in my Flex client it displays "2010-06-06 15:00:01".
Ultimately, I want the dates displayed in the local time zone of the event, which is the date I set it to. Therefore, when I am in Belgium and I set the start date of the event "2010-06-07 00:00:01", I want to get it this way.
But I got lost as to which layer fits that. Is the time zone stored in the MySQL DATETIME columns (I can't see it in MySQL)? Can Hibernate translate it into java.lang.Date with time zone information? And ultimately, what is the best way to solve this mess?
source
share