Depends on which kind you're looking for.
The current integer Unix Timestamp (1350517005) can be retrieved like so:
SELECT UNIX_TIMESTAMP();
MySQL often displays timestamps as date/time strings. To get one of those, these are your basic options (from the MySQL Date & Time reference):
SELECT CURRENT_TIMESTAMP;
SELECT CURRENT_TIMESTAMP();
SELECT NOW();
Answer from Brad Koch on Stack OverflowDefaulting a "date" field to the current datetime?
Getting timestamp using MySQL - Stack Overflow
Changing the default time zone of a current timestamp in MySQL - Databases - SitePoint Forums | Web Development & Design Community
mysql - CURRENT_TIMESTAMP in milliseconds - Stack Overflow
Videos
I'm not sure why I can't do this, but trying to alter a date field to default to the current timestamp throws an error in phpmyadmin.
I've tried several other default values such as "now()" and "current_date" and they're failing as well. How do I get it so that when a user creates a new record.
Should I just change the type of the column to DATETIME or TIMESTAMP from date?
Depends on which kind you're looking for.
The current integer Unix Timestamp (1350517005) can be retrieved like so:
SELECT UNIX_TIMESTAMP();
MySQL often displays timestamps as date/time strings. To get one of those, these are your basic options (from the MySQL Date & Time reference):
SELECT CURRENT_TIMESTAMP;
SELECT CURRENT_TIMESTAMP();
SELECT NOW();
CURRENT_TIMESTAMP is standard SQL and works on SQL server, Oracle, MySQL, etc. You should try to keep to the standard as much as you can.
For MySQL (5.6+) you can do this:
SELECT ROUND(UNIX_TIMESTAMP(CURTIME(4)) * 1000)
Which will return (e.g.):
1420998416685 --milliseconds
To get the Unix timestamp in seconds in MySQL:
select UNIX_TIMESTAMP();
Details: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_unix-timestamp
Not tested PostgreSQL, but according to this site it should work: http://www.raditha.com/postgres/timestamp.php
select round( date_part( 'epoch', now() ) );