0

I can't find a way to change this date format: 2015-01-07T06:12:25+0000

to Jan. 07, 2015 using php. I have tried reading the docs but everything i am trying is failing me.

i currently pull the date from facebook post the date like this

$posts .= '

'. $post->updated_time .'

';

everything i read always marks the post as a duplicate and refers the person asking to the same post. which i have read about 100 times now and everything i try doesn't work.

so if you mark it as a duplicate please also make a comment notating what I am not catching

i can't comment on that "duplicate" page because my rep is so low. i created an account for this question.

it doesn't convert my time from date_atom to Jan. 07, 2015 format. '.$post->updated_time' pulls the date from the facebook feed. but pulls it as date_atom format. and i just want it to show as Jan. 07, 2015 format. I don't know why its so hard for me to get that answer on there. i can't ask on the "duplicate" page because my rep is so low but you won't let me ask on here because its a "duplicate" question even though nobody posted a working solution for me.

here is my code:

<?php

$page_id = '******';
$access_token = '*************';
//Get the JSON
$json_object = @file_get_contents('https://graph.facebook.com/' . $page_id . 
'/posts?access_token=' . $access_token);
//Interpret data
$fbdata = json_decode($json_object);



foreach ($fbdata->data as $post )
{


$posts .= '<p><font color="#ffffff" size="big"> '. $post->updated_time .' </font></p>';
$posts .= '<p><table bgcolor="#838383"><tr><td style="width: 50%;"><img src="' . $post->picture . ' "  width="100%"/></td><td><p>' . $post->story . '</p><p>' . $post->message . '</p><br /><a href="' . $post->link . '">Follow Link</a> <a href="'. $post->actions->link . '">View Post</a></td></tr></table></p>';


$posts .= '<br />';
}
//Display the posts
echo $posts;

?>
  • What does "doesn't work" _mean_? _Why_? It's all very well saying that the duplicate doesn't solve your issue, but when it's the standard way of doing something and you've given no indication of what's wrong with it, it's going to remain the standard way of doing it. – Ben Feb 02 '15 at 08:53
  • because i try what i read it won't work. it doesn't convert. and i can't comment on that page because my rep is so low. i created an account for this question. it doesn't convert it. '.$post->updated_time' pulls the date from the facebook feed. but pulls it as date_atom format. and i just want it to show as Jan. 07, 2015 format. I don't know why its so hard for me to get that answer on there. i can't ask on the "duplicate" page because my rep is so low but you won't let me ask on here because its a "duplicate" question even though nobody posted a working solution for me. – Troy Beard Jr. Feb 05 '15 at 10:04

0 Answers0