473,327 Members | 1,997 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

next day of the week logic problem

I'm stuck on what seems like should be a relatively easy problem.

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
selections.

All suggestions appreciated.

Mar 19 '08 #1
1 2186
On 19 mar, 15:38, "Keychain" <some...@somewhere.comwrote:
I'm stuck on what seems like should be a relatively easy problem.

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
selections.

All suggestions appreciated.
like this?
mktime (0, 0, 0, date("m") , date("d")+1, date("Y"));
http://www.php.net/manual/en/function.mktime.php
Mar 20 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: nasht | last post by:
Hi, Interesting question: A user fills a form about how often an event happen. He has 4 fields: . In any of them, he can enter "*" as a joker, to say it doesn't matter. For example, his...
33
by: Steven Bethard | last post by:
I feel like this has probably been answered before, but I couldn't find something quite like it in the archives. Feel free to point me somewhere if you know where this has already been answered. ...
2
by: Psybar Phreak | last post by:
hi all, im developing a site in perl with mason on a postgreSQL backend. i currently have a page that lists all items in a table, but would like to do the " << PREVIOUS 1 2 3 4 NEXT>> "...
2
by: Chapai | last post by:
Hi all! I need your help to realize algorithm for stored proc or trigger. tool: SQL TABLE:
8
by: Lars-Erik Aabech | last post by:
Hi! We've got an ASP.NET application that runs swell on development PC's and one live production server. Another prod. server though crashes a couple of times a week. Either something that...
18
by: Jen | last post by:
Is it possible (how) to display a new record every week (or day) from a recordset?
10
by: Jim | last post by:
I'm sure this has been asked before but I can't find any postings. I have a table that has weekly inspections for multiple buildings. What I need to do is break these down by the week of the...
3
by: sbaird | last post by:
Aloha from Hawaii, I'm beating my head on the wall here. I have a recruiting contact managment database I'm trying to create. Managers (there ar 14 of them) have to make a certain number of...
9
by: Joe Kovac | last post by:
Hi! Our customer wants to see his data week by week. So, how could I let him select a week the most easy way? Anyone already solved this challenge? Proposal (1): Use a calendar to select the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.