One way to do this is to store all date information relative to the GMT time-zone regardless of the server and client time-zones. Whenever a client interacts with a date you simply convert it from GMT to the client's specific time-zone and back as needed.
Well, after 12 hours of investigation, I finally got this to work ;) Here's how:
- Configure the server to use the GMT time-zone by inserting default-time-zone=UTC (case sensitive) in my.cnf
- Set the useLegacyDatetimeCode MySQL driver parameter to false. This fixes this bug: http://bugs.mysql.com/bug.php?id=15604
- When reading/writing dates from/to the database always use UTC dates
No comments:
Post a Comment