How to use the expression mysql NOW() in doctrine querybuilder?
In Doctrine2 you have to use one of the following instead of NOW()
.
This:
CURRENT_TIMESTAMP()
Or:
...
createQuery(...'WHERE x.date = :now')
->setParameter('now', new \DateTime('now'))
...
If you want only time or only date use one of those:
CURRENT_TIME()
and CURRENT_DATE()