如何将 Facebook Graph API 日期转换为 UNIX 时间戳?
问问题
9796 次
2 回答
16
Facebook 最近添加了一项功能,其中日期/时间将以 Unix 时间戳格式返回,只需将date_format=U
查询参数添加到 Graph 调用的末尾即可。例如:
https://graph.facebook.com/me/events?date_format=U&access_token=.....
这将以 Unix 时间戳格式(例如 1309572000)返回时间/日期。
注意:到目前为止,只有时间戳格式的 updated_time 而不是 start_time
于 2013-06-07T18:19:49.143 回答
6
我不知道日期格式,但我怀疑它是通用和/或标准格式,所以strtotime()
应该可以正常工作。
$timestamp = strtotime('2012-04-24T22:01:00+0000');
于 2012-05-02T16:30:46.713 回答