It didn't import my corresponding dates. All of my posts from Blogger are now posted as the same date - the date I imported them.
How can I import the dates as well or is that not possible?
Please help!
D.
Code: Select all
$entry['title'] = $this->decode($item['title']);
$entry['timestamp'] = $this->decode(strtotime(isset($item['pubdate']) ? $item['pubdate'] : $item['dc:date']));
if ($entry['timestamp'] == -1) {
$entry['timestamp'] = time();
}
Code: Select all
$entry['title'] = $this->decode($item['title']);
$entry['timestamp'] = $this->decode(strtotime(isset($item['pubdate']) ? $item['pubdate'] : $item['dc:date']));
if ($entry['timestamp'] == -1) {
// strtotime does not seem to parse ISO 8601 dates
if (preg_match('@^([0-9]{4})\-([0-9]{2})\-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})\-([0-9]{2}):([0-9]{2})$@', isset($item['pubdate']) ? $item['pubdate'] : $item['dc:date'], $timematch)) {
$entry['timestamp'] = mktime($timematch[4] - $timematch[7], $timematch[5] - $timematch[8], $timematch[6], $timematch[3], $timematch[2], $timematch[1]);
} else {
$entry['timestamp'] = time();
}
}