Time with subsecond precision

suggest change

Remarks

You need to be at MySQL version 5.6.4 or later to declare columns with fractional-second time datatypes.

For example, DATETIME(3) will give you millisecond resolution in your timestamps, and TIMESTAMP(6) will give you microsecond resolution on a *nix-style timestamp.

Read this: http://dev.mysql.com/doc/refman/5.7/en/fractional-seconds.html

NOW(3) returns the server clock in the session time zone, with millisecond precision.

A decimal literal such as 0.001 is not always an IEEE 754 double. Dividing an integer millisecond count by 1000 avoids treating that factor as binary floating point.

Feedback about page:

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



Table Of Contents