We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 here.

how to compare datetime values in find method

i want to get all the values which are less than current datetime....how to get them?

                               $disbursals = CorporateDisbursal::find(array("status=:pending: AND disbursal_date < =:date:", 'bind' => array('pending' => Constants::FILE_PENDING, 'date' => date("Y-m-d H:i:s"))));
edited Mar '17

Hi, it depends on what data type you have in your MySQL column 'disbursal_date'.

I parse the database data record using strtotime function ('Parse about any English textual datetime description into a Unix timestamp') and compare it to for example time() function;

Just exactly you did, just make sure that disbursal_date column is datetime type.