且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Django mysql数据库不接受日期格式

更新时间:2023-10-17 18:19:46

该消息说,您需要以YYYY-MM-DD格式(日期为4位数字,月份为2位,日期为2位)传递日期。相反,从您的示例中我们可以看到,您使用的是passong 1994-26-01,即YYYY-DD-MM(因为26只能是一天)。因此,您会收到错误消息。

The message says that you need to pass the date in the YYYY-MM-DD format (4 digits for year, 2 for month, 2 for day). Instead, as we can see from your example you are passong "1994-26-01" which is YYYY-DD-MM (since 26 can only be day). That's why you are receiving the error.

您需要修正传递的日期时间格式,YYYY-DD-MM在任何情况下均无效。

You need to fix the datetime format you pass, YYYY-DD-MM is not valid in any case.