我正在使用Instagram的API来获取给定个人资料发布的最新视频或照片。它工作得很好,除了我似乎不能理解"created_time“值的含义。
$feed = file_get_contents("https://api.instagram.com/v1/users/".$id."/media/recent/?access_token=".$access_token."&count=1");
$feed = @json_decode($feed, true);
$created_on = $feed['data'][0]['created_time'];本例中的$created_on变量被设置为1382576494。当我试着做的时候,
echo date('M j, Y', strtotime($created_on));我收到一条错误消息。Instagram使用的是哪种格式?
发布于 2013-10-25 14:08:20
Instagram使用的是unix时间戳,因此在您的情况下:
echo date('M j, Y', $created_on);https://stackoverflow.com/questions/19582235
复制相似问题