marvino's avatar

DateTime::__construct(): Failed to parse time string

Good day .. I need your help. When i click the show button in the system this will show . I dont know what are possible cause and how to fix this ... ErrorException DateTime::__construct(): Failed to parse time string ({"id":2019,"d_id":"374","o_id":"3","r_id":"4","remarks":"For action slip","status":"Forwarded","action":"Forwarded","file":null,"releasedby":"Sally","receivedby":null,"created_at":"2019-02-12 10:53:18","updated_at":"2019-02-12 10:53:18"}) at position 0 ({): Unexpected character (View: /home/cp290724/public_html/dts/dts/resources/views/transhow.blade.php)

0 likes
1 reply
bobbybouwmann's avatar

Well, it goes wrong in your transhow.blade.php file and it's about datetimes. So this tells we you're trying to parse something to a datetime, which is not valid for a datetime.

As I see it now is that you're passing a whole object to the datetime class instead of the given field

// You do this
{{ new \DateTime($model) }}

// But you need to do
{{ new \DateTime($model->created_at) }}

Please or to participate in this conversation.