I have a weird issue with datetimes in my database and PHP code.
Carbon::now()
currently returns 2018-03-08 01:33:47
which is correct, that is the time on my computer and in my country.
I put a record with the expires_at
value at 2018-03-08 02:32:02
which is in 1 hour (or 59 minutes of you want to become technical).
It wasn't displayed in my query, the query that is supposed to select all records where expires_at is before the current time, so non expired records.
Althought, when setting the datetime to 2018-03-09 01:32:28
it displays that it expires in 23 hours? If I post it anything older (say 14 hours after the current datetime) it will be shown as expired?
$keys = UserAccountKey::where('user_id', Auth::user()->id)
->whereDate('expires_at', '>=', Carbon::now())
->get();