MySQL Convert a millisecond-precision date / time value to text.


Example

%f is the fractional precision format specifier for the DATE_FORMAT() function.

SELECT DATE_FORMAT(NOW(3), '%Y-%m-%d %H:%i:%s.%f')

displays a value like 2016-11-19 09:52:53.248000 with fractional microseconds. Because we used NOW(3), the final three digits in the fraction are 0.