postgres date from timestamp code example
Example 1: postgres timestamp to datetime
to_timestamp(field_name)::timestamp
Example 2: postgres extract date from timestamp
SELECT DATE(SUBSTRING('2018-07-25 10:30:30' FROM 1 FOR 10));
to_timestamp(field_name)::timestamp
SELECT DATE(SUBSTRING('2018-07-25 10:30:30' FROM 1 FOR 10));