开发者

Convert date in php

开发者 https://www.devze.com 2023-01-23 00:37 出处:网络
How to convert \"Thu Oct 28 16:33:29 +0000 2010 \" to like\"Oct 28,201开发者_开发知识库0 at 10:33PM\"Use the strtotime function combined with the date function

How to convert "Thu Oct 28 16:33:29 +0000 2010 " to like "Oct 28,201开发者_开发知识库0 at 10:33PM"


Use the strtotime function combined with the date function

echo date("jS F, Y", strtotime("11/25/10"));
// outputs 25th November, 2010 


$date = DateTime::createFromFormat('Thu Oct 28 16:33:29 +0000 2010', 'D M j h:m:s O Y');
echo $date->format('M d,Y, h:mA');

Relevant docs here

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号