VolcovMeter VolcovMeter - 1 year ago 71
PHP Question

How to display particular time format in PHP's Laravel/Lumen?

In my view, I have this code:

@foreach ($tickets as $t) {
<p> {{ $t->updated_at }} </p>

Which ultimately produces:

2016-08-18 01:23:45

Is there anyway to do something to the effect of:

{{ $note->updated_at("l, h:i A") }}

So that what shows is:
Thursday, 01:23 AM

Answer Source

Basically, the date/datetime properties in Eloquent are converted to Carbon object, so you can do it like this,

{{ $note->updated_at->format("l, h:i A") }}
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download