ALL TIMES WILL BE DISCUSSED IN MILITARY TIME TO AVOID CONFUSIONS WITH PM and AM!
Im making a reminders script and I need a little help with the time zones section and sending out the reminders.. so tell me if this is right.
A variable is set, which includes the server's timezone. For the purposes of this code:
$servertimezone = -4 // PHP recognizes -4 as -4, right?
then the user selects a time zone:
$sendingtime = "5:40";
$usertimezone = 6;
So the server adds the two time zones, to give it the local time to send the Reminder, right? In this case, its 2, so it then adds 2, to the hours part and gets the time it needs to send the reminder:
$sendat = "7:40";
Am I right? I cant ever get time zones right! Ok anyways, even If am wrong, the next part involves PHP.
Suppose I need to add 2 hours to the users input:
sendingtime = "23:30";
but adding two would give me "25:30"; which isnt valid. Is there a way to tell PHP its adding dates, maybe?
Now for the last problem, I sure have a lot of them! The script will be run on cron every 5 minutes. Now, each time it is run, it needs to look through the tables and find any values that are +5 minutes from the time it is running at, and send the reminders.
I cant figure out how to code so that it sends any reminders +5 minutes from its executrion.
Thanks in advance for helping me.