From 4848758006829defffabacecbafb28df67d79645 Mon Sep 17 00:00:00 2001 From: truthhun <1272881215@qq.com> Date: Fri, 13 Oct 2023 17:16:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=AB=99=E7=82=B9=E5=9C=B0?= =?UTF-8?q?=E5=9B=BE=E6=97=B6=E9=97=B4=E6=A0=BC=E5=BC=8F=E4=B8=8D=E6=AD=A3?= =?UTF-8?q?=E7=A1=AE=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- model/util.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/model/util.go b/model/util.go index 60ea5e6..da7d0ef 100644 --- a/model/util.go +++ b/model/util.go @@ -54,7 +54,7 @@ func (m *DBModel) UpdateSitemap() (err error) { for _, doc := range documents { su = append(su, sitemap.SitemapUrl{ Loc: fmt.Sprintf("%s/document/%d", domain, doc.Id), - Lastmod: doc.UpdatedAt.Format("2006-01-02 15:04:05"), + Lastmod: doc.UpdatedAt.Format(time.RFC3339), ChangeFreq: sitemap.DAILY, Priority: 1.0, }) @@ -65,7 +65,7 @@ func (m *DBModel) UpdateSitemap() (err error) { } sitemapIndexes = append(sitemapIndexes, sitemap.SitemapIndex{ Loc: domain + "/" + file, - Lastmod: time.Now().Format("2006-01-02 15:04:05"), + Lastmod: time.Now().Format(time.RFC3339), }) page++ } @@ -84,7 +84,7 @@ func (m *DBModel) UpdateSitemap() (err error) { for _, article := range articles { su = append(su, sitemap.SitemapUrl{ Loc: fmt.Sprintf("%s/article/%s", domain, article.Identifier), - Lastmod: article.UpdatedAt.Format("2006-01-02 15:04:05"), + Lastmod: article.UpdatedAt.Format(time.RFC3339), ChangeFreq: sitemap.DAILY, Priority: 1.0, }) @@ -95,7 +95,7 @@ func (m *DBModel) UpdateSitemap() (err error) { } sitemapIndexes = append(sitemapIndexes, sitemap.SitemapIndex{ Loc: domain + "/" + file, - Lastmod: time.Now().Format("2006-01-02 15:04:05"), + Lastmod: time.Now().Format(time.RFC3339), }) page++ }