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

JWWalker
  • 22,385
  • 6
  • 55
  • 76
user3177305
  • 49
  • 3
  • 12

1 Answers1

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))}}
Sojan Jose
  • 3,168
  • 6
  • 33
  • 52