I'm working on a PHP(CodeIgniter)/MySQL application that allows users select when their blog post will be published. How I have designed it to work so far is as below:
- User sets the timezone in his/her profile.
- User sets the publish date of the blog post. This date/time is assumed to be based on user's timezone.
- Based on user's timezone, the publish date is converted to UTC (00:00).
- The converted date is stored as DATETIME in mysql.
- Server frequently converts the stored DATETIME values to server timezone and publishes the content when their time has come.
I was wondering if there is a better way to handle this situation, considering that my DB server and web server are on different machines on the cloud and might change location as well.