Jump to content

Convert RSS Date to different date format


D-Dayve

Recommended Posts

Hello,

Right now i am getting the date via an rss feed so the date looks like:

Wed, 26 Nov 2008 06:47:52 -0800

 

I want the date to look like 11/26/2008 i dont even want/care about time and the -0800 part.

 

What would be the best/most efficient php way to convert it?

 

Thanks alot!  ;)  ;D

well...the -0800 is kind of important as it is the timezone offset. but strtotime() can convert it to a timestamp, and then date() can format it:

 

$data = 'Wed, 26 Nov 2008 06:47:52 -0800';
print date('m/d/Y',strtotime($date));

 

more on date formats here: http://us.php.net/date

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.