PHP Convert ISO date to more readable format?

前端 未结 7 1000
长情又很酷
长情又很酷 2021-01-11 16:27

Just a simple question. How do I convert a PHP ISO time (like 2010-06-23T20:47:48-04:00) to something more readable? Is there a function already built in PHP? I\'ve looked a

7条回答
  •  梦谈多话
    2021-01-11 16:47

    Try this:

    echo date( "Y-m-d H:i:s", strtotime("2010-06-23T20:47:48-04:00") );
    

    Format this part "Y-m-d H:i:s" using format from this documentation http://php.net/manual/en/function.date.php

提交回复
热议问题