How to properly format last modified (lastmod) time for xml sitemaps

后端 未结 6 538
礼貌的吻别
礼貌的吻别 2021-02-05 05:37

I am creating an app that will automatically update sitemap.xml each time new content is added to, or updated on the site.

According to Google\'s best pract

6条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-05 06:34

    The format for the lastmod field in Google Sitemaps XML for C# is the following:

    var lastmod = DateTime.Now.ToString("yyyy-MM-ddTHH:mm:sszzz");
    

    It provides values such as 2018-08-24T09:18:38-04:00 which is the W3C Datetime format.

提交回复
热议问题