How to get difference of days/months/years (datediff) between two dates? October 30, 2022 by Tarik Simply subtract them: SELECT ('2015-01-12'::date - '2015-01-01'::date) AS days; The result: days ------ 11