I trying to select the objects called programations in a bd table where the atribute end_at Is greater or equal than to a variable called $rightnow, both variables are a date type whit year, month, day, hour, minute and second. The problem is that the query only filters the year, month and day fields. Do not use hour, minutes, or seconds to filter. How can I make the filter complete? I'm using a elocuent query in a laravel project.
$rightNow = Carbon::now(new DateTimeZone('America/Santiago'));
$formatted_date = $rightNow->toDateTimeString();
$programations = Programation::where('end_at', '>=', $formatted_date)->orderBy('play_at', 'asc')->get();
The table is in a MySQL database.
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire