简体   繁体   中英

WHERE clause date is greater than 24h - Carbon / Laravel

I Am making a query where I need to find all the results for reminder that are greater than 24h in that database.

My query looks like this but its wrong I believe

$reminder = Reminder::where('reminder_date','<', Carbon::now()->addHours(24))
                          ->get();

Using Laravel / Carbon

It looks like you might be using the wrong operator. < (Less than) should be swapped for > (Greater than):

$reminder = Reminder::where('reminder_date','>', Carbon::now()->addHours(24))
                      ->get();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM