Issue
I am trying to get hours and minutes and seconds in blade, normally I use like below
{{$calllog['delivery_date']}}
but now my requirement is to get hours and minutes and seconds. here is how I tried to get
$calllog['delivery_date']->todatestring()}}
Yeah, I think I misuse for this function, can someone help me out? I am new in Laravel. Any help would be greatly appreciated.
Solution
If your variable is a DateTime, you can use this :
{{ Carbon\Carbon::parse($calllog['delivery_date'])->format('H:i:s') }}
Or simplest way (depends on your version) :
{{ $calllog['delivery_date']->format('H:i:s') }}
Answered By - Vincent Decaux
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.