HaveF / feedparser

Automatically exported from code.google.com/p/feedparser
Other
0 stars 0 forks source link

Fails to parse dates of format: 10/04/2014 03:45:49 #424

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Parse a feed with dates like this: <pubDate>10/04/2014 03:45:49</pubDate>

What is the expected output? What do you see instead?
'published_parsed' is None

Expected 'published_parsed' to contain a time.struct_time(tm_year=2014, 
tm_mon=4, tm_mday=10, tm_hour=3, tm_min=45, tm_sec=49, tm_wday=3, tm_yday=100, 
tm_isdst=-1)

(as produced by time.strptime("10/04/2014 03:45:49", "%d/%m/%Y %H:%M:%S")

What version of the product are you using? On what operating system?
5.1.3

Original issue reported on code.google.com by bendi...@gmail.com on 10 Apr 2014 at 11:11

GoogleCodeExporter commented 9 years ago
The project hasn't been updated in nearly a year, perhaps fix it and PR it in?

Original comment by vidpla...@gmail.com on 23 Apr 2014 at 11:44

GoogleCodeExporter commented 9 years ago
Thanks for reporting this! I could potentially fix this but that is an 
ambiguous date time format -- it could represent April 10 or October 04! I'll 
have to consider how that could be handled.

Let me review this and consider whether this will be a worthwhile addition and 
whether the ambiguity problem could be resolved neatly.

Original comment by kurtmckee on 10 Jul 2014 at 2:09

GoogleCodeExporter commented 9 years ago
I doubt it's possible to know if they use the silly US date format with the 
month first, so one solution would be to default to dd/mm/yyyy, and make it 
possible to provide an optional input date format used in time.strptime.

Original comment by bendi...@gmail.com on 13 Jul 2014 at 11:41