I'm looking for code/script in PHP to help solve this issue.
Server is running time at UTC. A web user will have a box for everyday of the week MON-SUN and in that box they can enter a time for everyday to send an email. The web user have there own timezone used so lets say PST -8.?
Example:
User has entered MON 8:00AM to send the email, all settings are saved in mysql. When it becomes 8AM on monday PST it will send the email.
Currently I had a PHP script that will run every minute to check SQL to see if any user has it set for that time.
Problem that i'm having is finding a solution since the server is UTC. I would rather not have the script check EVERY user and change to there timezone to check if the times match to sent the email since it feels like a waste. Other methods I have tried have not worked since they never truly go by the Users timezone.
The way SQL is setup is every user has an entry and there are 3 columns for everyday of the week like, MON_active, MON_time, MON_content.