Convert to date format dd/mm/yyyy

前端 未结 6 934
感动是毒
感动是毒 2020-12-01 06:29

I have the following date: 2010-04-19 18:31:27. I would like to convert this date to the dd/mm/yyyy format.

6条回答
  •  暖寄归人
    2020-12-01 07:07

    $source    =    'your varible name';
    $date    =     new DateTime($source);
    $_REQUEST["date"]    =     $date->format('d-m-Y');
    
    echo $_REQUEST["date"];
    

提交回复
热议问题