From 772b4c3258ae12f6a108d146d9674525e7e6b597 Mon Sep 17 00:00:00 2001 From: Ryan Pendleton Date: Sun, 6 Oct 2019 03:29:42 -0600 Subject: [PATCH 1/2] fix timezones by using the reference timezone expected by Go Go's reference date uses -07:00 for the timezone, so we need to use that in the time format. If we don't, the timezone in the date provided by the server will be ignored and an incorrect timezone of +07:00 will be added instead. Timezones that are + will still be generated correctly. --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index 7935f47..150d566 100644 --- a/main.go +++ b/main.go @@ -23,7 +23,7 @@ const ( var ( // Sitemap time format is 2012-05-06T02:23:17+00:00 - SitemapTimeFormat = strings.Replace(time.RFC3339, "Z", "+", -1) + SitemapTimeFormat = strings.Replace(time.RFC3339, "Z", "-", -1) MaxDepth = 500 throttle *uint = flag.Uint("c", 1, "pages to crawl at once") maxCrawl *uint = flag.Uint("max-crawl", 0, "maximum number of pages to crawl (0 = unlimited)") From 8162d2a1c0b54bccab94ffa0f8fa8ddf259fd441 Mon Sep 17 00:00:00 2001 From: Ryan Pendleton Date: Sun, 6 Oct 2019 03:33:36 -0600 Subject: [PATCH 2/2] update example date to match Go's reference date --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index 150d566..c79be4c 100644 --- a/main.go +++ b/main.go @@ -22,7 +22,7 @@ const ( ) var ( - // Sitemap time format is 2012-05-06T02:23:17+00:00 + // Sitemap time format is 2006-01-02T15:04:05-07:00 SitemapTimeFormat = strings.Replace(time.RFC3339, "Z", "-", -1) MaxDepth = 500 throttle *uint = flag.Uint("c", 1, "pages to crawl at once")