# Datediff between two dates

**URL:** <https://meta.discourse.org/t/datediff-between-two-dates/323799>\
**Category:** Data & reporting\
**Created:** [August 28, 2024, 3:35pm UTC](https://meta.discourse.org/t/datediff-between-two-dates/323799 "2024-08-28T15:35:06Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![SStrong](https://avatars.discourse-cdn.com/v4/letter/s/ee7513/32.png) [@SStrong](https://meta.discourse.org/u/SStrong)\
**Post date:** [August 28, 2024, 3:35pm UTC](https://meta.discourse.org/t/datediff-between-two-dates/323799/1 "2024-08-28T15:35:06Z")

</div>

I’ve tried following the below link to work this out myself but cannot quickly enough

What I would simply like to do is a date diff between topic created date and today’s date to be able to say “this topic is 6 days old”

These are the two fields I am working with:

to\_char(date\_trunc(‘DAY’, t.created\_at)::date,‘DD/MM/YYYY’) AS “Topic created date”,  
to\_char(date\_trunc(‘DAY’, now())::date,‘DD/MM/YYYY’) AS “Today date”

[PostgreSQL: Documentation: 9.6: Date/Time Functions and Operators](https://www.postgresql.org/docs/9.6/functions-datetime.html)

Thanks

---

_[View the full topic](https://meta.discourse.org/t/datediff-between-two-dates/323799)._
