You can just use plain php
{{ date('HH:MM', $shift->time_start) }}
or better use the presenter pattern https://github.com/laracasts/Presenter
I get and error. A non well formed numeric value encountered
eg. of time value = 20:00:00 {{ date('HH:MM', '20:00:00') }} produces error as well
This works
{{ date('G:i', strtotime($shift->time_start)) }}
At the end I create a view and converted the time field to a data time field and used this instead
{{ $shift->shift_start->format('H:i') }}
Apparently $shift->time_start is not a unix tims tamp which is required by date function
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community