postgres 12 date_trunc code example Example: date_trunc postgres SELECT DATE_TRUNC('hour', TIMESTAMP '2017-03-17 02:09:30');