How to format date using DateTime class in PHP

1 Answer

0 votes
$dt = DateTime::createFromFormat('m-d-Y', '03-25-2019')->format('Y-d-m');
echo $dt;
      
 
   
/*
run:
        
2019-25-03
       
*/

 



answered Mar 25, 2019 by avibootz

Related questions

...