Create a table with columns to store sub-second time

suggest change
CREATE TABLE times (
     dt DATETIME(3), 
     ts TIMESTAMP(3)
 );

makes a table with millisecond-precision date / time fields.

INSERT INTO times VALUES (NOW(3), NOW(3));

inserts a row containing NOW() values with millisecond precision into the table.

INSERT INTO times VALUES ('2015-01-01 16:34:00.123','2015-01-01 16:34:00.128');

inserts specific millisecond precision values.

Notice that you must use NOW(3) rather than NOW() if you use that function to insert high-precision time values.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents