I have a database table with articles, and each of these articles has a submission date. I need to calculate the days and hours since the article was published in a database, for example:
This article has been published 4 hours ago.
This article has been published 3 days and 4 hours ago.
Already have some code that I can reuse for this? I searched on Google, but maybe I am not using the right words.
Any clue that can help me?
Regards,
source
share