PHP 将Twitter API日期时间转换为MySQL日期时间格式
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了PHP 将Twitter API日期时间转换为MySQL日期时间格式相关的知识,希望对你有一定的参考价值。
function convert($twitter_datetime = '') {
$mysql_format = date("Y-m-d H:i:s", strtotime($twitter_datetime));
return $mysql_format;
}
// SIMPLE USAGE
$date = convert("Sat, 15 Oct 2011 00:29:53 +0000");
// WILL RETURN 2011-10-14 00:29:53
以上是关于PHP 将Twitter API日期时间转换为MySQL日期时间格式的主要内容,如果未能解决你的问题,请参考以下文章
将 Twitter 时间转换为特定格式的日期时间,以计算一天的推文频率
Twitter Api如何将unicode转换为字符串?
使用PHP将twitter搜索API中的tweets保存到MySQL数据库中
PHP中的Twitter API格式“created_at”[重复]
将带有 GMT 的字符串转换为日期时间格式 - php [重复]
NSDateFormatter 将日期从 twitter-timeline 设置为 (null)