On Mar 27, 10:25 am, Toby A Inkster <usenet200...@tobyinkster.co.uk>
wrote:
> GorseFox wrote:
> > Attempts to use strtotime($rssdate) have failed...
>
> What version of PHP are you using. Parsing the example date you provided
> with strtotime seems to work fine here with PHP 5.2.5.
>
> --
> Toby A Inkster BSc (Hons) ARCS
> [Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
> [OS: Linux 2.6.17.14-mm-desktop-9mdvsmp, up 21:39.]
>
> Best... News... Story... Ever!
> http://tobyinkster.co.uk/blog/2008/03/23/hypnotist/
Toby, I'm using PHP 5.2.5
I have no idea what the problem was, but I have managed to circumvent
the problem. I have no doubt that there is a better way, but this is
the approach I used:
// Now the publication date needs adjusting because the feedburner
provides it with a 5 hour offset
$rss_date_array = explode(" ",$item_published_date); // Get the
components of the date
$tmp[0] = $rss_date_array[1]; // Day
$tmp[1] = $rss_date_array[2]; // Month
$tmp[2] = $rss_date_array[3]; // Year
$tmp[3] = $rss_date_array[4]; // Time of day
$tmpstr = implode(" ",$tmp); // Recreate a string
$offset = substr($rss_date_array[5],1,2); // Grab the hour offset
from UTC
$rss_timefmt = strtotime($tmpstr); // Converts the date from the
feed to a timestamp
$rss_adjusted = $rss_timefmt + ($offset * 60 * 60); // and adjust by
the requisite number of seconds