Working with Unix timestamps in MySQL and Postgres

The following are examples of how to work with unix timestamps in both MySQL/MariaDB and Postgres.

MySQL/MariaDB

To get the current date and time in MySQL (based on the timezone of the server):

select unix_timestamp(now());