我有“清华,2011年6月30日07:34:33 +0000”作为来自Twitter RSS feed的时间戳。我的服务器在东部时间。我需要一些将其转换为unixtime的方法。我不知道从哪里开始。我猜推特应该在太平洋时间,除非是24小时。
我还有另一个使用相同格式的rss提要。有什么想法吗?甚至不知道我会在谷歌上输入什么来找到这个问题的答案。
发布于 2011-10-02 11:44:07
使用strtotime();
例如:strtotime("Thu, 30 Jun 2011 07:34:33 +0000")
发布于 2011-10-02 11:44:34
使用strtotime()函数:
date_default_timezone_set($user_timezone); // Set the user's timezone if you'd like
$time = strtotime("Thu, 30 Jun 2011 07:34:33 +0000") // Convert the time
echo date("l M j \- g:ia", $time); // Print it in any format you want!为了将来的参考,下次在Google上试试"php twitter date unix“:)
https://stackoverflow.com/questions/7624466
复制相似问题