Jump to content

atom feed date format


bhavin12300

Recommended Posts

date_default_timezone_set('America/Los_Angeles');
$date = strtotime('2010-02-19T17:23:53-05:00');
echo date('r', $date);

 

You'll want to look at the manual page for the date function to figure out what your desired date string is.  I used 'r' because it was simple and close, but you can construct any date format you desire.  In some cases, you need to set default_timezone_set(), so you should set that relative to your server.

date_default_timezone_set('America/Los_Angeles');
$date = strtotime('2010-02-19T17:23:53-05:00');
echo date('r', $date);

thanks,

i got it. i set date_default_timezone_set('Asia/Calcutta');

and its solved. thanks.

 

You'll want to look at the manual page for the date function to figure out what your desired date string is.  I used 'r' because it was simple and close, but you can construct any date format you desire.  In some cases, you need to set default_timezone_set(), so you should set that relative to your server.

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.