Error message here!

Hide Error message here!

忘记密码?

Error message here!

请输入正确邮箱

Hide Error message here!

密码丢失?请输入您的电子邮件地址。您将收到一个重设密码链接。

Error message here!

返回登录

Close

Laravel return date problem

wx5bffdbaf11b62 2021-07-26 11:16:09 阅读数:2 评论数:0 点赞数:0 收藏数:0

problem :

"created_at": "2021-03-10T20:29:26.000000Z"

What we need is mm / DD / yyyy, hours, minutes and seconds , The solution is as follows  

Put the following code in the corresponding Model in

introduce

use DateTimeInterface;

Method

 protected function serializeDate(DateTimeInterface $date)
{
return $date->format('Y-m-d H:i:s');
}

 

Copyright statement
In this paper,the author:[wx5bffdbaf11b62],Reprint please bring the original link, thank you

编程之旅,人生之路,不止于编程,还有诗和远方。
阅代码原理,看框架知识,学企业实践;
赏诗词,读日记,踏人生之路,观世界之行;