I'm using Instagram's API to fetch a given profile's most recent video or photo that was posted. It's working well, except that I can't seem to make sense of what the "created_time" value means.
$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'];
The $created_on
variable in this case is set to 1382576494
. When I try to do,
echo date('M j, Y', strtotime($created_on));
I get an error message. What sort of format is Instagram using?
Instagram is using unix timestamp, so in your case:
echo date('M j, Y', $created_on);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With