0

So the title is quite self explanatory: I was trying to datetime.strptime(news.date, '%a, %d %b %Y %H:%M %Z') and it didn't work out for Tue, 19 Nov 2019 09:00 EST but got a ValueError. I tried to use datetime.strptime(news.date[:-4], '%a, %d %b %Y %H:%M') and it all works just fine. How do I fix this timezone issue?

Update: the timezone will be used later, so I do need to process it as well

H8oddo
  • 123
  • 9
  • Sounds like there may be a problem with your system's timezone DB, it doesn't contain `EST`. – Barmar Nov 22 '19 at 16:26
  • 1
    `strptime` only accepts timezones present in `time.tzname`. – CDJB Nov 22 '19 at 16:27
  • Possible duplicate of [Python strptime() and timezones?](https://stackoverflow.com/questions/3305413/python-strptime-and-timezones) – stovfl Nov 22 '19 at 18:06

0 Answers0