What should the Length/Value be for "DATE" data type in mysql?

Viewed 828

I looked for the answer to this question before posting this but I couldn't find it. I'm sorry if it has been asked before but I would like to know what I should enter for the Length/Value for "DATE" in mysql.

Thanks in advance

enter image description here

2 Answers

Perhaps you are referring to this? DATETIME and TIMESTAMP have an optional length. It refers to the number of decimal places (up to 6) for fractional seconds. Certain other functions also have this convention:

mysql> SELECT NOW(), NOW(6);
+---------------------+----------------------------+
| NOW()               | NOW(6)                     |
+---------------------+----------------------------+
| 2021-12-10 22:56:14 | 2021-12-10 22:56:14.927507 |
+---------------------+----------------------------+

(But, I don't think you need the parens on DATETIME.)

Related