Convert the time format in php

前端 未结 2 1114
小鲜肉
小鲜肉 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 04:53

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

    echo date("l F jS, Y", strtotime("Thu, 08 Jul 2010 15:51:01"));
    
    0 讨论(0)
  • 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

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