Google Sitemap Date Format

前端 未结 10 1746
情书的邮戳
情书的邮戳 2021-02-12 09:35

I need date format for sitemaps in php.

How can i do that ?

Is this output right ?

2012-08-02EEST18:01:18+03:00
         


        
10条回答
  •  一整个雨季
    2021-02-12 10:32

    Actually, there are 2 approaches to this.

    The first approach is to set a valid date for XML sitemap which includes the "C" char which gave the value: (2019-06-03T17:30:21-05:00). Test it here

    '.date('c', strtotime($row['date'])).'

    The 2nd approach is to set a valid date for RSS sitemap which includes the "r" char which gave the value: (2019-03-07T17:55:44+00:00).

    '.date('r', strtotime($row['date'])).'

    Hope this helps you. Thanks

提交回复
热议问题