Microseconds in MariaDB
Understand microsecond precision. This concept page explains how MariaDB stores and handles fractional seconds in time data types.
CREATE TABLE example(
col_microsec DATETIME(6),
col_millisec TIME(3)
);CREATE FUNCTION example(x DATETIME(5)) RETURNS TIME(4)
BEGIN
DECLARE y TIMESTAMP(6);
RETURN CAST(x AS time(2));
END;SELECT STR_TO_DATE('20200809 020917076','%Y%m%d %H%i%s%f');
+-----------------------------------------------------+
| STR_TO_DATE('20200809 020917076','%Y%m%d %H%i%s%f') |
+-----------------------------------------------------+
| 2020-08-09 02:09:17.076000 |
+-----------------------------------------------------+Additional Information
See Also
Last updated
Was this helpful?

