Convert RSS pubDate to a timestamp
Try This:
$pubDate = $item->pubDate;
$pubDate = strftime("%Y-%m-%d %H:%M:%S", strtotime($pubDate));
You can use the built-in function strtotime()
. It takes a date string as its first argument and returns a Unix timestamp.
http://php.net/manual/en/function.strtotime.php