I want to compare if the post date day is equal to the current day. But below example is not working. Do you know why? The date column is of "datetime" type.
$post= Post::Query();
…
elseif($range == "week") {
$post= $post->where('date', <', Carbon::now()->addDays(7));
}
elseif($range == "day") {
$post= $post->where('date', '=', Carbon::today());
}
....
When the user selects the current day in the select menu, no results appear, but select week works.
Carbon::today()
includes the time at00:00:00
– Withdraw