postgres extract time from timestamp code example
Example 1: postgres extract date from timestamp
SELECT DATE(column_name) FROM table_name;
Example 2: postgres extract time from timestamp
select cast(timestamp '2014-04-03 12:34:00' as time)
-- equivalent to
select '2014-04-03 12:34:00'::time
Example 3: postgres extract date from timestamp
SELECT '2018-07-25 10:30:30'::TIMESTAMP::DATE;