-2

INSERT INTO covernote (issue_date) VALUES ( STR_TO_DATE ( '13-May-13','%Y-%m-%d') );

ortan
  • 1
  • 1
  • 1
    Because May is not %m see https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_date-format – P.Salmon Mar 02 '21 at 07:24

2 Answers2

2

Because May is not %m see https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_date-format - %b for abbreviated month or %M for full month name

+--------------------------------------+--------------------------------------+--------------------------------------+
| STR_TO_DATE( '13-May-13','%Y-%m-%d') | STR_TO_DATE( '13-May-13','%Y-%b-%d') | STR_TO_DATE( '13-May-13','%Y-%M-%d') |
+--------------------------------------+--------------------------------------+--------------------------------------+
| NULL                                 | 2013-05-13                           | 2013-05-13                           |
+--------------------------------------+--------------------------------------+--------------------------------------+
1 row in set, 1 warning (0.106 sec)

It's a pity you picked may as a representative sample..

P.Salmon
  • 14,173
  • 2
  • 10
  • 18
1

Per the documentation on date formatting, %m is the code for "Month, numeric (00..12)".

You are looking for %M, which represents "Month name (January..December)"

samuei
  • 688
  • 2
  • 14