更改Facebook"end_time"的格式 [英] Change Format of Facebook "end_time"

查看:62
本文介绍了更改Facebook"end_time"的格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以建议将以下内容转换为"2012年1月27日08:00:00 + 0000"到"1月27日"的函数吗?

Can anyone suggest a function to convert this: "2012-01-27T08:00:00+0000" to "Jan 27"?

推荐答案

这可以通过使用strtotime和date这两个函数来完成. Strtotime: http://php.net/manual/en/function.strtotime.php将时间转换为Unix时间戳
日期:用于格式化特定的日期/时间.

This can be done by using two functions strtotime and date. Strtotime : http://php.net/manual/en/function.strtotime.php to convert the time to Unix timestamp
Date : to format specific date/time.

date('M d',strtotime('2012-01-27T08:00:00 + 0000'));

date('M d', strtotime('2012-01-27T08:00:00+0000'));

其中M =月,d =日期

where M = Month and d = date

这篇关于更改Facebook"end_time"的格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆