Reputation: 8385
I am getting a result of Sat 1 Dec 2 pm - 12pm
when I should be getting Sat 1 Dec, 2pm - 2:45pm
and I am unsure why I am not getting it correct with the times.
$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)\/"
Upvotes: 0
Views: 95
Reputation: 15301
$finish = date('ga',$finishO / 1000);
should be:
$finish = date('ga',$finishConvert / 1000);
$finishO
is an invalid timestamp causing date to see 0 which defaults to unix epoch.
Upvotes: 2