I've got table with column of type date
. In my script, I generate date
array as follows :
$date2 = date('Y-d-m', strtotime($date2));
for ($i = 0; $i <= 7; $i++)
{
$date1 = str_replace('-', '/', $date2);
$tomorrow = date('Y-d-m',strtotime($date1 . "+".$i." days"));
echo 'counted date : '.$tomorrow.PHP_EOL ;
array_push($dates, $tomorrow);
}
And got the following output :
counted date : 2016-01-08
counted date : 2016-02-08
counted date : 2016-03-08
counted date : 2016-04-08
counted date : 2016-05-08
counted date : 2016-06-08
counted date : 2016-07-08
counted date : 2016-08-08
I also got Phalcon expression :
$status1 = $app
->modelsManager
->executeQuery("
SELECT *
FROM MastersFullTime
WHERE MastersFullTime.date = :date:
AND MastersFullTime.master_id = :master_id:"
,
array(
'date' => $date ,
'master_id' => $master_id
)
);
But WHERE MastersFullTime.date = :date:
not working. How can I compare date
objects? Thanks in advance!