Convert Time Using Mysql Laravel 5
i want to view the time which store on DB 12:00:00 as 12:00 PM.
here is my code
$late_running = Late_runnings::select(DATE_FORMAT('late_time','%h:%i %p')) ->where('user_id', '=', $driver_id->id) ->where('role_id', '=', 1) ->get();
im getting follwing error
date_format() expects parameter 1 to be DateTimeInterface, string given
DATE_FORMAT is a mysql property so you need to select it as a raw sql like,
didn't test it give it a try. :)
- → "failed to open stream" error when executing "migrate:make"
- → October CMS Plugin Routes.php not registering
- → OctoberCMS Migrate Table
- → OctoberCMS Rain User plugin not working or redirecting
- → October CMS Custom Mail Layout
- → October CMS - How to correctly route
- → October CMS create a multi select Form field
- → October CMS - Conditionally Load a Different Page
- → How to disable assets combining on development in OctoberCMS
- → October CMS - Radio Button Ajax Click Twice in a Row Causes Content to disappear
- → OctoberCms component: How to display all ID(items) instead of sorting only one ID?
- → In OctoberCMS how do you find the hint path?
- → How to register middlewares in OctoberCMS plugin?