When I subtract timestamps, the interval is in form DD:HH:MM:SS. How can I convert it all to minutes without extracting days and hours and multiplication/addition? I'm looking for a single function which I can substitute for date_part in this query so that it returns 65:
date_part
select date_part('minutes', '65 minutes'::interval);
Context: I need to know how many minutes have passed since given timestamp.
SELECT EXTRACT(EPOCH FROM '2 months 3 days 12 hours 65 minutes'::INTERVAL)/60;
seems to work.
WARNING: "seems" is the key word.
1.4m articles
1.4m replys
5 comments
57.0k users