formatting-timestamps

Table of Contents

Timestamps

Formatting Timestamps

SELECT to_char(now() - '2020-05-28 5:30'::timestamp, 'HH:MI');

DateTime Formatting in Postgres

Convert a timestamp to minutes:

SELECT extract(epoch from (now() - '2020-05-28 5:30'::timestamp)) / 60;