Answer the question
In order to leave comments, you need to log in
How to insert current time in milliseconds into mysql?
`updated` = NOW() + 0 doesn't work for me for some reason
Answer the question
In order to leave comments, you need to log in
If you have mysql 5.6 and above use this:
If below, you will have to set it via php.
A little theory:
mysql> CREATE TABLE fractest( c1 TIME(2), c2 DATETIME(2), c3 TIMESTAMP(2) );
Query OK, 0 rows affected (0.33 sec)
mysql> INSERT INTO fractest VALUES
> ('17:51:04.777', '2014-09-08 17:51:04.777', '2014-09-08 17:51:04.777');
Query OK, 1 row affected (0.03 sec)
mysql> SELECT * FROM fractest;
+-------------+------------------------+------------------------+
| c1 | c2 | c3 |
+-------------+------------------------+------------------------+
| 17:51:04.78 | 2014-09-08 17:51:04.78 | 2014-09-08 17:51:04.78 |
+-------------+------------------------+------------------------+
1 row in set (0.00 sec)
SELECT MICROSECOND('2010-12-10 14:12:09.019473');
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question