0

我正在尝试创建 RSS 提要 此提要未验证。从

<pubDate><?php echo $topNewest->data['last_update'] ?></pubDate>

回声 <pubDate>2012-10-02 13:00:00</pubDate>

我希望替换元素必须是 RFC-822 日期时间

<pubDate>Wed, 02 Oct 2002 13:00:00 GMT</pubDate>
4

1 回答 1

0

使用DateTimephp 中内置 RFC822 的类

 $d = new DateTime($topNewest->data['last_update']);
 echo $d->format(DateTime::RFC822);

如果需要,您可以更改格式,查看 php.net/date

于 2014-03-26T08:29:22.327 回答