0

I need to parse RSS feed. I am using feedparser on python. Basically my task is to run script every N seconds and check for last feed. I come up with idea to check is date is younger than 15 seconds each iteration. But there is a problem pubDate has different timezone.

'Published_parsed' I think working not correct because it gives me these:

2020-06-17 05:46:45
-
Wed, 17 Jun 2020 04:46:45 GMT

and this

2020-06-17 11:19:39
-
Wed, 17 Jun 2020 10:19:39 IST

Thus it's not parsed to one timezone. I tried to check it to each timezone using pytz, but there is no IST timezone, what is not good to me.

How can I parse this varioty of dates to one timezone time.

Wed, 17 Jun 2020 13:12:43 IST

Tue, 16 Jun 2020 21:49:32 GMT

Roman Hrybinchuk
  • 147
  • 1
  • 14
  • Check out this answer: https://stackoverflow.com/a/43042469/18771 (and the rest of the thread) – Tomalak Jun 17 '20 at 08:27
  • @Tomalak, They have IST indeed. But their ist is Irish time, when my is Indian.Hah – Roman Hrybinchuk Jun 17 '20 at 08:51
  • Well... "IST" is indeed ambiguous. According to Wikipedia it could also mean "Israel". Looks like no software in the world can guarantee to solve this problem correctly on its own. If you have no influence over the RSS generation, you could replace "IST" with e.g. "GMT+1" for Ireland before parsing the date. – Tomalak Jun 17 '20 at 11:21

0 Answers0