John Davidson

php - Format DATETIME during laravel blade foreach loop to only show time

0 comments
Message:


Here is my loop. Prints multiple records along with date/time column


@foreach($tableData as $i)
<tr>
<th scope="row">{{$i->name}}</th>
<td>{{$i->duration}}</td>
<td>{{$i->friendsAmount}}</td>
<td>{{$i->time)}}</td>
</tr>
@endforeach

This prints under the time column


2020-11-14 19:42:00

I only want it to display the time


19:42:00


My Answer:

{{ $i->id }}
{{ $i->name }}
{{ $i->created_at->format('H:i:s') }}

@endforeach

Rate this post

3 of 5 based on 4501 votes

Comments




© 2024 Hayatsk.info - Personal Blogs Platform. All Rights Reserved.
Create blog  |  Privacy Policy  |  Terms & Conditions  |  Contact Us