开发者

Doctrine: calculating datetime difference

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜