samedi 17 septembre 2016

Laravel 5.2 eloquent compare date time to current data and time

I am trying to make a notification for the agents in my CRM.

I store the date and time they pick in my database and compare it to the current data and time.

I have tried this:

$notification   = Main::select('id') -> whereRaw('Date(notification) = CurDate()') -> where('user_id', '=', $userid) -> get();

it works perfectly but compare only the current date with the saved date.

What I am looking for is to compare the current date and time with the stored date and time. If that time and date match or passed then do anything.

I don't want to use Carbon because I don't know how to use it.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire