php - How to formate variable returned as /Date(1465196400000)/ into a real date -


i pulling api, variables startdate , enddate return /date(1465196400000)/, can advise best approach format real date such mm/dd/yy?

the /date throwing me off.

here how can convert date using preg_match:

$data = '/date(1465196400000)/';  if (preg_match('#/date\((\d+)\)/#', $data, $result)) {     $date = date('d-m-y', $result[1] / 1000);     echo $date; // 06-06-2016 }; 

Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -