What does the number 6 in the MySQL DATETIME field mean?
P粉147747637
P粉147747637 2023-08-09 14:34:58
0
2
621
<p>I can't find it in DATETIME, but usually I define it as <code>DATETIME</code> without precision specifier. </p> <p>When running Hibernate automatic DDL update, I noticed that it changes the table to <code>DATETIME(6)</code></p>
P粉147747637
P粉147747637

reply all(2)
P粉347804896

It represents the precision of millisecond storage.


DATETIME(6) means that decimal milliseconds are stored to 6 decimal places. For example, 1970-01-01 17:51:04.789463.


The number must be in the range between 0 and 6.

P粉714844743

This is explained in detail on the next page of the table of contents (emphasis mine):

  • So DATETIME is equivalent to DATETIME(0).
  • And DATETIME(6) is not equivalent to DATETIME or DATETIME(0).
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template