I'm using Laravel Framework.
I want all of the rows for this day. This is what I tried:
DB::table('users')->where('created_at', '>=', date('Y-m-d H:i:s'))
(field created_at
represented in database in format: Y-m-d H:i:s
).
I'm using Laravel Framework.
I want all of the rows for this day. This is what I tried:
DB::table('users')->where('created_at', '>=', date('Y-m-d H:i:s'))
(field created_at
represented in database in format: Y-m-d H:i:s
).
date('Y-m-d H:i:s')
returns date of now.
If you want results from start of the day you can replace it with date('Y-m-d').' 00:00:00'
.
If you want results from last 24 hours you can replace it with date('Y-m-d H:i:s',time()-86400)
(86400 = 24*60*60)