Mega Code Archive

 
Categories / MySQL Tutorial / Data Types
 

TIMESTAMP NULL DEFAULT NULL

mysql> mysql> CREATE TABLE t1 (ts TIMESTAMP NULL DEFAULT NULL); Query OK, 0 rows affected (0.03 sec) mysql> mysql> INSERT INTO t1 VALUES (NOW()); Query OK, 1 row affected (0.00 sec) mysql> INSERT INTO t1 VALUES (CURRENT_TIMESTAMP); Query OK, 1 row affected (0.00 sec) mysql> mysql> select * from t1; +---------------------+ | ts                  | +---------------------+ | 2007-07-23 19:09:19 | +---------------------+ 2 rows in set (0.00 sec) mysql> mysql> drop table t1; Query OK, 0 rows affected (0.00 sec)