From 0f13bc3ddcd4ce9545670861d3ae8dc393ae76e7 Mon Sep 17 00:00:00 2001 From: Akhil Gupta Date: Sat, 6 Feb 2021 06:23:26 +0530 Subject: [PATCH] fix breaking time for seattle now --- service/podcastService.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/service/podcastService.go b/service/podcastService.go index cf74627..a1a824e 100644 --- a/service/podcastService.go +++ b/service/podcastService.go @@ -240,6 +240,15 @@ func AddPodcastItems(podcast *db.Podcast, newPodcast bool) error { modifiedRFC1123 := "Mon, 2 Jan 2006 15:04:05 MST" pubDate, _ = time.Parse(modifiedRFC1123, obj.PubDate) } + if (pubDate == time.Time{}) { + // RFC1123Z = "Mon, 02 Jan 2006 15:04:05 -0700" // RFC1123 with numeric zone + modifiedRFC1123Z := "Mon, 2 Jan 2006 15:04:05 -0700" + pubDate, _ = time.Parse(modifiedRFC1123Z, obj.PubDate) + } + + if (pubDate == time.Time{}) { + fmt.Printf("Cant format date : %s", obj.PubDate) + } if latestDate.Before(pubDate) { latestDate = pubDate