Codeigniter Change Fetched Date format in View

后端 未结 2 912
孤独总比滥情好
孤独总比滥情好 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:32

    You are just near to Output. In date format function use F for Full month Display.

    $date = "12-12-2015";
    echo date("F d, Y", strtotime($date));
    
    0 讨论(0)
  • 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

    0 讨论(0)
提交回复
热议问题