I am pulling stored dates from a database. Which when testing I use a sql command to advance the time by 45 minutes to make sure I know what should be displayed. I use the following to pick only the days and times that I want.
public function currentJobsList($array)
{
for ($i =0; $i < count($array);$i++)
{
if ($array[$i][5] == $this->selectedDay)
{
if ($array[$i][7] > date('G:i'))
{
$currentJobs [] = $array[$i];
}
}
if (($array[$i][5] == $this->selectedDay) && ($array[$i][5] != date('m/d/Y')) )
{
$currentJobs [] = $array[$i];
}
}
I know the time is greater than the time I run the command, but it returns no results in the morning. I have the time in military time I thought the am/pm format was throwing things off. That is not the case. If I switch the logic around (current time is less than stored time I get my result set...in the morning). What is going wrong with this?