A column of type TIMESTAMP can be automatically updated using ON UPDATE CURRENT_TIMESTAMP in the column definition.
However, this will not fill out when inserting a record. As you said, you can create a timestamp in PHP (format: YYYY-MM-DD HH:MM:SS ) and insert it, or you can set another attribute of the DEFAULT CURRENT_TIMESTAMP column in the column definition.
For more information: MySQL: TIMESTAMP Properties
UPDATE: If the unix timetstamp value is the desired output, save the value with TIMESTAMP and then get the unix value using:
SELECT UNIX_TIMESTAMP(your_column_name) FROM your_table_name
To insert using a unix timestamp, you can use FROM_UNIXTIME()
INSERT INTO (your_table_name) (your_column_name) VALUES (FROM_UNIXTIME(your_bigint_value));
Brendan bullen
source share