Convert the time format in php

前端 未结 2 1117
小鲜肉
小鲜肉 2020-12-12 04:01

How would I convert a date formatted like this Thu, 08 Jul 2010 15:51:01 into a date like this Thursday July 8th, 2010 3:51 pm. Also, how would I f

2条回答
  •  一生所求
    2020-12-12 05:04

    you can take a look at all of the possible date formatting options here http://www.php.net/manual/en/function.date.php

    Basically, with the date() function you construct a date in any format you want, for example

    echo date('l M d, Y');
    

    would output Thursday Apr 29, 2010

提交回复
热议问题