I know mysql does not support storing timestamp columns with millisecond .
My question is: is there a mysql function that I could write that will output the current time as the BIGINT (13) value in millisecond.
For example, since now () prints a timestamp:
mysql> select now();
+---------------------+
| now() |
+---------------------+
| 2010-10-27 11:24:23 |
+---------------------+
I would like to write a mysql function, for example ts (), which outputs bigint (13), for example.
mysql> select ts();
+---------------------+
| ts() |
+---------------------+
| 1288172185517 |
+---------------------+
My reasons for this is being able to populate the default value for a column with the value of the ts () function
e..g
`MY_TIMESTAMP_COLUMN` BIGINT(13) DEFAULT ts(),
source
share