Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Doctrine 1.2 how to compare dates

How can i set a condition, in a where clause of Doctrine 1.2 ORM to specify Greater than date in DQL example

Doctrine_Query::create()
    ->from('user u')
    ->where(?)
    ->execute();

Thanks

like image 892
Juan Jo Avatar asked Jul 14 '11 23:07

Juan Jo


1 Answers

For example:

$one_year_ago = date('Y-m-d H:i:s', strtotime('1 year ago'));

->where('u.created_at > ?', $one_year_ago)
like image 146
Tom Avatar answered Oct 15 '22 10:10

Tom