`datetime` columns in MySQL/MariaDB are not storing any precision for the time like milliseconds, apart from the `dd/mm/YYYY hh:mm:ss`.
As per official and latest documentation from MySQL v8.0:
If omitted, the default precision is 0
Below is a snippet taken from the official doc[1]:
MySQL has fractional seconds support for TIME, DATETIME, and TIMESTAMP values, with up to microseconds (6 digits) precision: To define a column that includes a fractional seconds part, use the syntax type_name(fsp), where type_name is TIME, DATETIME, or TIMESTAMP, and fsp is the fractional seconds precision. ... The fsp value, if given, must be in the range 0 to 6. A value of 0 signifies that there is no fractional part. If omitted, the default precision is 0. (This differs from the standard SQL default of 6, for compatibility with previous MySQL versions.)
So currently we are omitting the precision in both code and DDL scripts, thus we cannot work with milliseconds related stuff, whereas for the rest of supported and certified database we are currently working with precision time of milliseconds.
Also, having a look at the DDL scripts for both MySQL and MariaDB, I can see the following commented code from Maciej 5 years ago:
`datetime(6), to be used with mysql 5.6.4 that supports millis precision` [2] and [3]
Expected: datetime column format with milliseconds precision: `dd/mm/YYYY hh:mm:ss.SSS`.
[1] https://dev.mysql.com/doc/refman/8.0/en/fractional-seconds.html
- is cloned by
-
JBPM-9746 Precision time (milliseconds) for datime columns should be taken into account for MySQL and MariaDB
- Resolved