私の問題: Jquery datepicker カレンダー入力と、その横に配置したドロップダウンを組み合わせて、時間、分、および AM/PM をキャプチャすると、印刷する適切な日付を取得できません。
これが私のphpコードです:
echo protect($_POST['truck_arrive'])." - truck arrive<br>";
echo protect($_POST['truck_arrive_hours'])." - truck arrive hours<br>";
echo protect($_POST['truck_arrive_mins'])." - truck arrive mins<br>";
echo protect($_POST['truck_arrive_ampm'])." - truck arrive ampm<br>";
$truck_arrive_comb = protect($_POST['truck_arrive']).protect($_POST['truck_arrive_hours']).protect($_POST['truck_arrive_mins']).protect($_POST['truck_arrive_ampm']);
echo $truck_arrive_comb." - truck arrive combination<br>";
echo strtotime($truck_arrive_comb)." - truck arrive combination string to time<br>";
echo date("Y-m-d h:i:s",strtotime($truck_arrive_comb))." - truck arrive combination string to time date format<br>";
//$truck_arrive = date("Y-m-d h:i:s",strtotime($truck_arrive_comb));
$truck_arrive = date("Y-m-d h:i:s",strtotime(protect($_POST['truck_arrive'])));
echo $truck_arrive." - truck arrive date format<br>";
そして、これを出力します:
01/16/2013 - truck arrive
01 - truck arrive hours
04 - truck arrive mins
AM - truck arrive ampm
01/16/20130104AM - truck arrive combination
- truck arrive combination string to time
1969-12-31 07:00:00 - truck arrive combination string to time date format
2013-01-16 12:00:00 - truck arrive date format