我正在使用 Search API 导入一些推文并获取返回的 JSON:
"results": [
{
"created_at": "Thu, 12 Apr 2012 04:58:01 +0000",
"from_user": "AdamHills",
"from_user_id": 23045431,
"from_user_id_str": "23045431",
"from_user_name": "Adam Hills",
"geo": null,
"id": 190302731255287800,
"id_str": "190302731255287808",
"iso_language_code": "sv",
"metadata": {
"result_type": "recent"
},
"profile_image_url": "http://a0.twimg.com/profile_images/1350305654/goteborgs-rape_normal.jpg",
"profile_image_url_https": "https://si0.twimg.com/profile_images/1350305654/goteborgs-rape_normal.jpg",
"source": "<a href="http://twitter.com/#!/download/iphone" rel="nofollow">Twitter for iPhone</a>",
"text": "@Adde77 Den ska finnas tillgänglig i slutet av april.",
"to_user": "Adde77",
"to_user_id": 99782511,
"to_user_id_str": "99782511",
"to_user_name": "Adde P",
"in_reply_to_status_id": 190222715716763650,
"in_reply_to_status_id_str": "190222715716763648"
}
我怎样才能得到那个特定推文的年龄,所以我可以4m ago
在我的页面上打印出类似的东西?那,created_at
字符串看起来一团糟!有没有简单的方法?