How to parse a date string in PHP?

后端 未结 2 1678
执笔经年
执笔经年 2020-12-01 18:23

With a date string of Apr 30, 2010, how can I parse the string into 2010-04-30 using PHP?

2条回答
  •  南方客
    南方客 (楼主)
    2020-12-01 19:06

    Try http://php.net/manual/en/function.strtotime.php to convert to a timestamp and then http://www.php.net/manual/en/function.date.php to get it in your own format.

提交回复
热议问题