简体   繁体   English

Doctrine 1.2 如何比较日期

[英]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 1.2 ORM 的 where 子句中设置条件以在 DQL 示例中指定大于日期

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

Thanks谢谢

For example:例如:

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

->where('u.created_at > ?', $one_year_ago)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM