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

authentication - Mongodb revoke acccess to connect test database -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -

r - Update two sets of radiobuttons reactively - shiny -