php - treating variable using datepicker and timestamp -
i have problem , can not solve on form date format like
dd/mm/yyyy hh/mm/ss need convert case register in database, column type timestamp
so i'm using basic function
function verify($a){ return $newdate = date("y-m-d h:i:s", strtotime($a)); } the problem when put more 13 days date not work.
just snowballing something:
function verify($a) { $dt = explode(' ',$a); $dt1 = explode('/',$dt[0]); $dt2 = explode('/',$dt[1]); return $newdate = date('y-m-d h:i:s',mktime($dt2[0],$dt2[1],$dt2[2],$dt1[1],$dt1[0],$dt1[2])); }
Comments
Post a Comment