echo $carbon_today; // the __toString will call format('Y-m-d H:i:s')
$carbon_today->toDateString(); // same as ->format('Y-m-d')
$carbon_today->toFormattedDateString(); // same as ->format('M j, Y')
$carbon_today->format('d-m-Y'); // custom format
Also,having problem with whereBetween function:
$carbon_time= Carbon::now();
$carbon_today= Carbon::today()->format('Y-m-d G:H:i');
$pagination =Orders::whereBetween('created_at', array( $carbon_today , $carbon_time))->paginate(5);
In DB exist data to made this query true, but no result. When I manualy put dates in query, get result. IS there a way to add ' ' on $carbon_time and $carbon_today I think that made a problem...
@pavlen Um 'Y-m-d G:H:i' would result in '2015-07-10 0:00:00' missing the leading 0, and the hour in place of the minutes and minutes where the seconds should be.
G = 24-hour format of an hour without leading zeros