Create a table in which timestamps can be stored.
mysql>
mysql> CREATE TABLE TSTAMP (COL1 TIMESTAMP);
Query OK, 0 rows affected (0.00 sec)
mysql>
mysql> SET @TIME = TIMESTAMP('1980-12-08 23:59:59.59');
Query OK, 0 rows affected (0.00 sec)
mysql>
mysql> INSERT INTO TSTAMP VALUES (@TIME + INTERVAL 3 MICROSECOND);
Query OK, 1 row affected (0.00 sec)
mysql>
mysql> SELECT COL1, COL1 + INTERVAL 3 MICROSECOND FROM TSTAMP;
+---------------------+-------------------------------+
| COL1 | COL1 + INTERVAL 3 MICROSECOND |
+---------------------+-------------------------------+
| 1980-12-08 23:59:59 | 1980-12-08 23:59:59.000003 |
+---------------------+-------------------------------+
1 row in set (0.00 sec)
mysql>
mysql> drop table tstamp;
Query OK, 0 rows affected (0.00 sec)
mysql>
Related examples in the same category