I'm doing something wrong here and hoping someone can fil me in. I have a routine that works great showing daily shifts up until midnight. Meaning it will show shifts for Monday for example until it switches to Tuesday and then it shows Tuesday shifts. This makes sense when the "day" is defined as 24 hours for each day. I need the shifts to continue to show for Monday for example until 5 a.m. the following day. So for example Monday shifts would continue to show until Tuesday 5 a.m. After Tuesday 5 a.m., it would switch from showing Monday shifts to showing Tuesday shifts. The same would be true of Wednesday 5 a.m., so on and so forth. I created a variable entitled $day_end_each setting it to 5 a.m. and then adding it to the day range but it's not working. Somehow it's completely ignored. Any ideas?
$day_end_each = mktime(05,0,0,date("m"),date("d")+1,date("Y"));
$day_end_each = date("Y-m-d H:i:s", $day_end_each);
if ( date("Y-m-d", strtotime($row["shift_" . $i . "_start"])) == date("Y-m-d", strtotime($date_each)) && date("Y-m-d H:i:s", strtotime($row["shift_" . $i . "_start"])) <= $day_end_each && $row["member_shift_" . $i . "_on_call"] == 0 ) {