How can i calculate the difference between datetime column and now (for example 'created_at' and NOW()) in Doctrine?
I Googled it alot and couldn't find an answer..
Th开发者_如何学Goanks in advance!
Have you tried this?
$query->select('DATEDIFF(NOW(), datetime column)')
try $query -> select(DATE_DIFF(CURRENT_DATE(), datetime column))
DQL dont use now() sql function, they use CURRENT_DATE() instead
精彩评论