简体   繁体   English

无效的日期时间格式:1366不正确的整数值:

[英]Invalid datetime format: 1366 Incorrect integer value:

This is my controller and columns type is int(11) in database 这是我的控制器,数据库中的列类型为int(11)

 $req['date_time'] = ($req->date_time) ? Carbon::createFromFormat('d/m/Y', $req->date_time)->timestamp : '0';
                $req['publish_date'] = ($req->publish_date) ? Carbon::createFromFormat('d/m/Y', $req->publish_date)->timestamp : '0';
                $req['expiration_date'] = ($req->expiration_date) ? Carbon::createFromFormat('d/m/Y', $req->expiration_date)->timestamp : '0';
                CmsArticle::create($req->all());                                           

Are you sure all the columns are integers? 您确定所有列都是整数吗? SQL Server returns that error when an invalid value is used where a datetime type is needed. 当在需要datetime类型的地方使用了无效值时,SQL Server将返回该错误。

Perhaps the value 0 shouldn't be used, and instead insert a null or a special date far in the past? 也许不应该使用值0 ,而是在过去很久之前插入一个null或特殊日期?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 日期时间格式无效:1366 integer 值不正确 - Invalid datetime format: 1366 Incorrect integer value QLSTATE [22007]:无效的日期时间格式:1366 不正确的 integer 值 laravel - QLSTATE[22007]: Invalid datetime format: 1366 Incorrect integer value laravel Laravel 8:SQLSTATE[22007]:无效的日期时间格式:1366 不正确的 integer 值 - Laravel 8: SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect integer value SQLSTATE [22007]:无效的日期时间格式:1366不正确的整数值 - SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect integer value SQLSTATE [22007]:无效的日期时间格式:1366 不正确的 integer 值:问题 - SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect integer value: problem 无效的日期时间格式:1366 字符串值不正确 - Invalid datetime format: 1366 Incorrect string value laravel 5.7如何解决“无效的日期时间格式:1366不正确的整数值:”错误? - How to fix “Invalid datetime format: 1366 Incorrect integer value: ” error in laravel 5.7? 无效的日期时间格式:1366不正确的整数值:''对于第1行的列`facemock` .login_token` .id` - Invalid datetime format: 1366 Incorrect integer value: '' for column `facemock`.`login_token`.`id` at row 1 SQLSTATE [22007]:无效的日期时间格式:1366 不正确的 integer 值:“isVisible”列的“true” - SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect integer value: 'true' for column 'isVisible' SQLSTATE [22007]:无效的日期时间格式:1366错误的整数值:行1的列'infraction_id'的'[“ 1”,“ 3”,“ 66”,“ 68”]' - SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect integer value: '[“1”,“3”,“66”,“68”]' for column 'infraction_id' at row 1
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM