Search code examples
symfony1doctrinedatediff

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

Thanks in advance!


Solution

  • Have you tried this?

    $query->select('DATEDIFF(NOW(), datetime column)')