我需要 php 站点地图的日期格式。
我该怎么做?
这个输出对吗?
<lastmod>2012-08-02EEST18:01:18+03:00</lastmod>
最佳答案
如果你有时间戳,你可以像这样正确地格式化日期:
<lastmod><?php echo date('c', $timestamp); ?></lastmod>
时间戳可以是 time()
(当前时间)或其他获取 unix 时间戳的方法,例如 strtotime()
关于php - 谷歌站点地图日期格式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11780404/