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

Popular posts from this blog

css - SVG using textPath a symbol not rendering in Firefox -

Java 8 + Maven Javadoc plugin: Error fetching URL -

datatable - Matlab struct computations -