Reputation: 163
I need to convert a timestamp to a unix_timestamp in Postgres.
The timestamp being in the following format: 2019-05-09 11:40:01
Thanks
Upvotes: 0
Views: 64
Reputation: 1271091
Use extract(epoch from . . . )
:
select extract(epoch from '2019-05-09 11:40:01'::timestamp)
Upvotes: 1