What is best way to set a Weekly & Monthly alarm?

Hi,

Let me get just right into what we need to get done. We need a Php code that sends alert to our member as per Alerts that
they have set up for their events. Which events they can schedule to happen Weekly, Monthly or on a fixed date.
On a fixed date, no problem, we got that running with a Cron that runs hourly and checks for all Alerts that need to be sent
out as per events that are due on a given date that are X Hours from current Hour.

What I am having difficulty with is with the Weekly & Monthly event alerts.
Example:

  1. John has an event that happens every Friday, at 9PM, and he wants his event subscribers to be alerted, which we do via email, 6 Hours before
    start of the event as to the XYZ info about this event.

  2. Jane has an event that happens on 30th of each Month, and she wants her event subscribers to be alerted 24 Hours before
    start of the event as to the XYZ info about this event. NOTE: February has no 30th day.

How would you code this?

Set up a php script as a cron job to execute at a regular interval, have the script check to see it matches the conditions you want, then have it send the email.

Well as I wrote we have a Php Script via a Cron Job that checks to see the conditions match for the fixed date, one time, events.
My question was/is:

what conditions to check in case of Weekly & Monthly recurring events?

How are you storing the events information?

The conditions would be whatever you specify in your PHP code pulled from wherever your data is stored. Here’s a little bit of pseudocode that might better illustrate what I mean:

if($thesubscriber=="john" && $today=="Friday" && $time=="9:00PM EST"){
     sendmail();
}