Working with Unix timestamps in PostgreSQL

Current date/time to Unixtime (to the nearest second, hence the trunc):

select trunc(extract(epoch from now()));

Note this will include your timezone.

Unix time stamp to PostgreSQL timestamp

select to_timestamp(<unix timestamp>)