Categories
Laravel how to compare date correctly?
$q->where('created_at', '>=', $dateFrom) $dateFrom has the format 'Ymd' . Hours are stored in the database, so the condition for equality does not work, only if it is less than a day
$q->where('created_at', '>=', $dateFrom)
Answer the question
In order to leave comments, you need to log in
Good evening. Approximately like this:
$q->where('created_at', '>=', $dateFrom . ' 00:00:00');
Didn't find what you were looking for?
Ask a Question
731 491 924 answers to any question