1

I want to convert a date I queried from the database, to explain it further here is my code on views.

    @foreach($myquery as $mydate)
    <tr>
        <td>{{ Date::createFromFormat('l',$mydate->logon)}}</td>
        <td></td>
        <td></td>
        <td></td>
    </tr>
    @endforeach

what I want to output is just the Day, Example: mondays, fridays etc $mydate->logon outputs 2014-11-25 10:28:09

0

1 Answer 1

0

You can use the date function to get the name of the day, after converting your time into Unix Timestamp . For converting your time to Unix timestamp you can use

strtotime

use the 'l' modifier, for the full textual representation when using the date function . so in laravel you can get desired output with

{{date('l',strtotime($mydate->logon))}}
0

Not the answer you're looking for? Browse other questions tagged or ask your own question.