I have a system that generates reports and sends out an email to users.
Users can choose what time they want the reports sent, I store their desired time in mysql.
The servers run in GMT/UTC and I store their requested report time in the database in GMT/UTC as well.
When they pick the time they want off the webpage I convert the PHP timezone (like Asia/Hong_Kong or America/Chicago) and save the time they want their report into mysql in GMT/UTC.
I then query the database and send their report at their requested time. Works fine this way, until... daylight savings time kicks in.
Of course not every place has daylight savings, and not every place adjusts by the same number of minutes and not on the same date every year and not all places adjust on the same dates of the year.
How can I calculate the correct time, so the system is correct all year?
I am using PHP to store the timezones and storing the date/time in mysql, so these are the two tools I have available.