Google Sitemap日期格式 [英] Google Sitemap Date Format

查看:177
本文介绍了Google Sitemap日期格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用php中的站点地图的日期格式。

I need date format for sitemaps in php.

我该怎么做?

这是输出权?

<lastmod>2012-08-02EEST18:01:18+03:00</lastmod>


推荐答案

如果有时间戳,则可以正确格式化日期像这样:

If you have the timestamp you can format the date correctly like this:

<lastmod><?php echo date('c', $timestamp); ?></lastmod>

时间戳记可以为 time()(当前时间)或其他获取unix tiemstamp的方法,例如 strtotime()

Time stamp could be time() (for current time) or some other method of fetching a unix tiemstamp like strtotime()

这篇关于Google Sitemap日期格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆