I am working on generating recurring dates using PHP to process the dates. I have a $startDateTime and $endDateTime. These two variables are for the first date in the series.
If the even repeats every Tuesday I need something along the lines of
$repeatDay = "Tuesday";
$followingDay = strtotime($startDateTime. " following $repeatDay");
Using "next $repeatDay" doesn't work since I am not generating the date from todays date.
EDIT:
It seems that every five loops the time jumps forward an hour in the date. This may be because $start="2014-04-29 11:00:00" and strtotime is only converting the date correctly.
How should I convert 2014-04-29 11:00:00 to a format that strtotime understands?
$firstOccurrence=strtotime($start);
$nextOccurence=strtotime("next $day", $firstOccurrence); //Set the first recurring date for this day
while($nextOccurence<=strtotime($activeUntil)){
echo date("M d, Y H:m:i",$nextOccurence)." | ";
$nextOccurence=strtotime("next $day", $nextOccurence);
}