timestamp in mysql code example
Example 1: mysql timestamp to date
-- Use the FROM_UNIXTIME() function in MySQL
select from_unixtime(timestamp) from my_tbl;
Example 2: date vs datetime
DATE : YYYY-MM-DD format
DATETIME : YYYY-MM-DD HH:MM:SS format
TIMESTAMP : X s from 1970 format
TIME : HH:MM:SS format
Example 3: timestamp mysql
1970-01-01 00:00:01
Example 4: mysql timestamp format
INSERT INTO ... VALUES ('YYYY-MM-DD HH:MM:SS');