4 February 2021

There is a simple function for when you need to extract count of days from interval. It is returned as as double, but converted to integer in this example. You get interval when you subtract two dates for an example.

Source code viewer
  1. date_part('day', NOW() - MY_DATE_COLUMN)::INTEGER
Programming Language: PostgreSQL