Sep 2, 2015
0
Level 1
Date value of datetime column using FLUENT in laravel 5.0
How could i get only de date of a datetime column in laravel 5 using fluent?
I want to compare this 2015-08-30 23:00:00 with this:
$dt = Carbon::now();
$d = $dt->toDateString();//this is the date only which i want to compare
There is a mysql function called DATE which extract the date part of a date or datetime expression like this DATE(`datetime`) but if i use it it gives me a integrity error.
Here's how i tried to use it:
$reservations = \DB::table('reservations')
->select('reservations.id','DATE(reservations.datetime)')
->get();
Please or to participate in this conversation.