在 Postgres 中将时间戳转换为 unix_timestamp

Converting a timestamp to a unix_timestamp in Postgres

我需要在 Postgres 中将时间戳转换为 unix_timestamp。

时间戳格式如下:2019-05-09 11:40:01

谢谢

使用extract(epoch from . . . ):

select extract(epoch from '2019-05-09 11:40:01'::timestamp)