Failed to parse time string (2018-03-10 13:08:09.-708656) at position 24 (6): Unexpected character

匿名 (未验证) 提交于 2019-12-03 09:05:37

问题:

I am getting this error sometimes then it goes away automatically. Unable to track why I am getting this error. And I think it get's fixed when the session expires. This is the error screen

(1/1) Exception DateTime::__construct(): Failed to parse time string (2018-03-10 18:06:52.-955808) at position 24 (8): Unexpected character  in Carbon.php (line 408) at DateTime->__construct('2018-03-10 18:06:52.-955808', object(DateTimeZone)) in Carbon.php (line 408) at Carbon->__construct('2018-03-10 18:06:52.-955808', null) in Carbon.php (line 457) at Carbon::now() in FileSessionHandler.php (line 70) at FileSessionHandler->read('SEOHFptNtGSB4YmLTb7IAegTxX6EZcAFGB2wnvPZ') in Store.php (line 96) at Store->readFromHandler() in Store.php (line 86) at Store->loadSession() in Store.php (line 70) at Store->start() in StartSession.php (line 103) at StartSession->Illuminate\Session\Middleware\{closure}(object(EncryptedStore)) in helpers.php (line 964) at tap(object(EncryptedStore), object(Closure)) in StartSession.php (line 104) at StartSession->startSession(object(Request)) in StartSession.php (line 58) at StartSession->handle(object(Request), object(Closure)) in Pipeline.php (line 148) 

回答1:

this error is due to a carbon update as mentioned by @btl i surfed a bit on the internet , if you added a library or ran composer update that would probably be the source of the problem , if you have any old laravel projects go to $root/vendor/nesbot/ , you will find a carbon folder there copy and replace that in your current project that isnt working and it will be fixed.if you want i can upload my carbon folder to google drive or something for you to use.

hope this helps.

EDIT

for those who dont have older apps , you can find the carbon file which will fix the issue here



回答2:

if you have any old laravel projects go to Project-Folder/vendor/nesbot/ , you will find a carbon folder there copy and replace that in your current project folder. That's the solution



回答3:

I found that if you strtotime it, it solves the issue:

Carbon::parse(strtotime($date)); 


标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!