TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP : Timestamp : Data Types MySQL TUTORIALS


MySQL TUTORIALS » Data Types » Timestamp »

 

TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP


mysql>
mysql>
mysql> CREATE TABLE t (ts TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP);
Query OK, rows affected (0.02 sec)

mysql>
mysql> INSERT INTO t VALUES (NOW());
Query OK, row affected (0.00 sec)

mysql> INSERT INTO t VALUES (CURRENT_TIMESTAMP);
Query OK, row affected (0.00 sec)

mysql>
mysql> select from t;
+---------------------+
| ts                  |
+---------------------+
2007-07-23 19:09:19 |
2007-07-23 19:09:19 |
+---------------------+
rows in set (0.00 sec)

mysql>
mysql> drop table t;
Query OK, rows affected (0.00 sec)



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

MySQL TUTORIALS

 Navioo Data Types
» Timestamp