Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
use dateparser for parsing dates #159
I recently worked with the dateparser module for parsing dates, and it seems it might be better than feedparser at its job. For example, it will support parsing internationalized dates and it can parse the date
I don't have time to patch this myself right now, but I wonder if it might not be as simple as doing:
try: import dateparser def dateparser_tuple(string): return dateparser.parse(string).utctimetuple() feedparser.registerDateHandler(dateparser_tuple) except ImportError: pass
In my tests, the above successfully parses the times specified above.
As dateparser trickles into various linux distributions and (hopefully) standardizes, the built-in date parsing code could eventually be replaced by dateparser as well.
Thank you for any advice.
@anarcat I completely agree that it would be great to replace a lot of the edge case date parsing with a dedicated date parser (like dateparser). My first thought is that I'd like to keep dedicated parsers for the date formats that are documented in the RSS/Atom specs, but there's a lot of edge case code that could fall back to a dedicated date parser!
Quick question: do you have experience with other libraries besides dateparser?
On 2019-03-05 16:56:18, Kurt McKee wrote: Quick question: do you have experience with other libraries besides dateparser?