php - Date in MySQL Laravel ORM -
i store dates in timestamp
type (and see in phpmyadmin simple 2015-04-14 00:00:00
). stupid? better way set int
type , save unix time?
how can query
select * `values` `time` < $mytimeinunix
because model::all()->where('time','<',$mytimeinunix)
not working.
regards
you're looking unix_timestamp:
model::where(db::raw('unix_timestamp(time)'), '<', $mytimeinunix)->get();
Comments
Post a Comment