I am calling an API from where I am getting date /Date(1365004652303-0500)/, I don\'t understand what format this is. How is this date format called? I was not
The following example uses the preg_match() and the DateTime class:
$date = '/Date(1365004652303-0500)/';
// get the timestamp
$pattern = '~/Date\(([0-9]*)~';
preg_match($pattern, $date, $matches);
$timestamp = round(((int) $matches[1]) / 1000);
$dt = new DateTime();
$dt->setTimestamp($timestamp);
echo $dt->format('Y-m-d H:i:s');