Cody S
Cody S

Reputation: 87

RSS pubDate an Hour behind when parsed through PHP. Daylight Savings Time?

This is probably a super simple question - but I'm a little boggled.

We're pulling in an RSS feed to list events on our site - but ever since DST they've been showing up as an hour behind (on the main, separate site they're showing up just fine).

For simplicity's sake, lets whittle it down to this:

$eventTime = "Thu, 05 Dec 2013 10:00:00 -0400";
$tz = date_default_timezone_get();

echo $tz. "<br />";
echo "Event Time: " .date('n/j/y g:ia O', strtotime($eventTime));

Which returns:

America/New_York 
Event Time: 12/5/13 9:00am -0500

After reading and reading and reading - I think it's safe to deduce that the timezone of the site pumping out the feed and our server are operating on different timezones. The only solutions I've been able to find is to set OUR timezone via date_Default_timezone_set() from New York to whatever the -0400 timezone is (...I...for the life of me can't figure out what it is) - but since we were fine BEFORE DST, wouldn't that mean that we have to readjust our timezone every time DST comes and goes?

Anyone have any advice or have I arrived at the conclusion to this issue myself?

Upvotes: 0

Views: 470

Answers (0)

Related Questions