MySQL 5.7 STR_TO_DATE

后端 未结 1 1728
悲哀的现实
悲哀的现实 2021-01-28 04:08

I am running MySQL 5.7 and wanted to convert some strings to date. I referred the manual here: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html#function_str-t

1条回答
  •  [愿得一人]
    2021-01-28 04:56

    As it says in the manual,

    If the NO_ZERO_DATE or NO_ZERO_IN_DATE SQL mode is enabled, zero dates or part of dates are disallowed. In that case, STR_TO_DATE() returns NULL and generates a warning

    That causes the result to be NULL in cases such like this, because your partial “date” contains zero values.

    0 讨论(0)
提交回复
热议问题