开发者

Formatting a facebook date with PHP

How do I format facebook's date string using php into something a bit prettier?

the format returned by the facebook graph api is

2011-08-26T15:50:21+0000

but I would like to display it in the format

26 August at 15:50
开发者_如何学编程

how would I go about doing this?


Use strtotime this will return a unix timestamp that you can then apply date on in your own format e.g..

$date = strtotime("2011-08-26T15:50:21+0000");
echo date("F j, Y, g:i a", $date);
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜