Convert a mysql date (datetime) into a better date format using php

前端 未结 3 1612
一向
一向 2021-01-19 03:15

I some php code which gets info from a mysql database. The problem is that the date is coming out in the format : \"2010-02-03 22:21:26\"

Does anyone kn

3条回答
  •  日久生厌
    2021-01-19 03:55

    date() function will assist you in this.

    Something like

    $date = date('j F, Y h:i:s', strtotime($date_value));
    print $date;
    

    Format options:

    http://www.php.net/manual/en/function.date.php

提交回复
热议问题