Laravel 4 timstamp -


i have field in mysql table type 'timestamp' , using calendar on view date in format dd/mm/yyyy. inserting data following code

$billing = new billing; $billing->date = input::get('date'); $billing->save(); 

it filling data 0000-00-00 00:00:00 in field. how can correct value. tried convert timestamp followed.

$billing = new billing; $billing->date = date("y-m-d h:i:s",strtotime(input::get('date'))); $billing->save(); 

but not working...can 1 help!!!

if understand correctly, mysql timestamps have saved strings in yyyy-mm-dd hh:ii:ss format (ie, returned date('y-m-d h:i:s')). convert date('y-m-d h:i:s'), strtotime(input::get('date')))


Comments

Popular posts from this blog

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -