I cannot figure out how to work with datetime objects in symfony2.
I have several game records in a database that have a datetime property. and now I want to compare with the actual date: I want to have all the records in the last 10 days. how can i achieve this
I tried this
date($game->getZeit(), mktime(0,0,0,date('m'),date('d'),date('y')))
to get a comparable date that I can compare with
date('Ymd H:i:s', mktime(0,0,0,date('m'),date('d'),date('y')));
but it does not work because
$game->getZeit()
cannot be converted to string. What for? so how can i debug this one? How can I find out its value? how can i compare it with other dates or date strings?
Quick help would be really appreciated! :)
respectfully
source share