PostgreSQL
 sql >> Database >  >> RDS >> PostgreSQL

Come convertire un timestamp in un numero intero (epoca Unix) in Postgres

SELECT EXTRACT(EPOCH FROM TIMESTAMP '2016-10-25T00:14:30.000');

SELECT EXTRACT(EPOCH FROM TIMESTAMP '2016-10-25T00:14:30.000' + INTERVAL '544 min');