当我得到Sat 1 Dec 2 pm - 12pm
时,我得到Sat 1 Dec, 2pm - 2:45pm
的结果,我不确定为什么我的时间不正确。
$startO = $openHome['Start'];
$finishO = $openHome['End'];
$startConvert = preg_replace('~\D~', '', $startO);
$start = date('D j M g a',$startConvert / 1000);
$finishConvert = preg_replace('~\D~', '', $finishO);
$finish = date('ga',$finishO / 1000);
$openHomeDetail = $start." - ". $finish;
$ startO& $ finishO:
"Start":"\/Date(1354323600000)\/","End":"\/Date(1354326300000)\/"
答案 0 :(得分:2)
$finish = date('ga',$finishO / 1000);
应该是:
$finish = date('ga',$finishConvert / 1000);
$finishO
是一个无效的时间戳,导致日期看到0,默认为unix纪元。