I am basically trying to convert a date field from my database in a few seconds. I used UNIX_TIMESTAMP in our old MySQL database and looked for an equivalent function in PostgreSQL.
Thanks in advance
SELECT extract(epoch FROM your_datetime_column) FROM your_table
More details in the manual:
http://www.postgresql.org/docs/current/static/functions-datetime.html#FUNCTIONS-DATETIME-EXTRACT
It:
select CURRENT_TIMESTAMP - '1970-01-01';
Gives you a type interval. You can get seconds from the result of this interval if you need it.
interval