I have a table with information about articles. I have a published_at
column that's a timestamp without time zone
and want to calculate how long ago each article was published, in days.
So if it was published a week ago, I should get back 7
.
Any idea how to go about?
I know Postgres has NOW()
but can I just subtract and then take DAY()
?
Thanks!