My query returns an object that has a date field
$obj = ObjectQuery::create()->findPK(11);
var_dump($obj)
shows me the date field asyyyy-mm-dd
like it is in the database$obj->getThedate();
changes the format tomm/dd/yy
which I don't want to happen$obj->getThedate("Y-m-d");
gives me same format in the databaseyyyy-mm-dd
So to get the data in the same format it's stored in the database, I need to set the format when I'm getting that specific date field, like the third line.
The problem is that I'm not reading the date field separately. I'm taking the full $obj as a whole and turning it into an array using Zend's toArray()
, so I don't have control over how toArray()
reads the date field. Is there a way to set Propel to deliver in the format ("Y-m-d")
as a default? Something maybe in the prople config settings?