Codeigniter Change Fetched Date format in View

后端 未结 2 911
孤独总比滥情好
孤独总比滥情好 2021-01-26 10:04

I have a date value from database as 12-12-2015
I tried the below code

$date = \"12-12-2015\";
echo date(\"M d, Y\", strtotime($date));
<         


        
2条回答
  •  伪装坚强ぢ
    2021-01-26 10:37

    Try this:

    $date = "12-12-2015";
    echo date("F d, Y", strtotime($date));
    

    Reference Link:http://php.net/manual/en/function.date.php

提交回复
热议问题