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..

Thanks in advance!

有帮助吗?

解决方案

Have you tried this?

$query->select('DATEDIFF(NOW(), datetime column)')
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top