바라기를 이것은 지식이있는 사람에게는 빠른 것이지만 Zend 프레임 워크 프로젝트에서 RSS 피드에 대한 올바른 날짜/시간 형식을 얻으려고 문제를 겪고 있으며 사용 가능한 모든 리소스를 공개했습니다. php datetime 내가 완전히 이해할 수없는 유일한 리소스는 젠드 문서이다. Impl는 정확하게 정적 클래스를 호출하는 방법도 정확하게 알려지지 않았다. Zend Date_time. 또한 DB 필드는 datetime 형식입니다 ...젠드 RSS 피드 pubDate 시간 형식화
XML 형식으로 pubDate를 제외하고 피드에 모든 데이터를 가져 오는 것이 좋습니다. 형식이 올바르게 인식되지 않아 피드가 각 게시물의 현재 날짜를 뱉어 버리고 있습니다. Heres까지 내가 가지고있어 ...
public function rssAction()
{
$this->_helper->layout->setLayout('xmllayout');
$model = new Default_Model_News;
$newsitems = $model->fetchAll();
$date = date("D\, j M Y G:i:s");
$feedArray = array (
'title' => "Postgoldforcash News Feed",
'description' => "Postgoldforcash News Feed",
'link' => "http://www.postgoldforcash.com",
'language' => 'en-EN',
'charset' => 'utf-8',
'docs' => "Postgoldforcash News",
'pubDate' => $date,
'entries' => array()
);
foreach ($newsitems as $article) {
$fDate = date_format(new DateTime($article->publishDate), "r");
$feedArray['entries'][] = array (
'title' => $article->title,
'link' => $article->url."/", // for some reason i have to add a blank space or '/' in otherwise it breaks...
'guid' => $article->title,
'description' => $article->content,
'pubDate' => $fDate
);
}
$feed = Zend_Feed::importArray($feedArray, 'rss');
$feed->send();
}
나는 올바른 형식을 포함하는 모든 다른 방법을 시도했다;
date_format(new DateTime($article->publishDate), "D\, j M Y G:i:s");
strftime ($article->publishDate, "%a, %d %b %Y %H:%M:%S %z") ;
gmdate(DATE_RSS, strtotime($article->publishDate));
모든 포인터가 좋을 것입니다!
'$ article-> publishDate'의 정확한 형식은 무엇입니까? – Vika
mysql의 시간대 필드 예 : 2009-10-15 00:00:00 – sinewave