Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- next day of the week logic problem
March 19, 2008, 6:38 pm
rate this thread
I'm creating a simple scheduler. From a form consisting of seven checkboxes
(one for each day of the week) the user selects the days s/he would like an
event to occur at the same time each day. The selections are stored in the
database as a serialized array and periodically checked via cron to
calculate how much time until the next event is to occur. For example let's
say the user selects Monday, Wednesday & Saturday @ 1:00pm. So if the
current day/time is Sunday @ 3:15pm, the next event will occur in 21:45.
I know strtotime() will calculate the length of time, but my dilemma is how
to determine the next day in the revolving sequence of days from the user's
All suggestions appreciated.