pombreda / feedparser

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

mssql date parser uses hardcoded tokyo timezone #247

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I am puzzled by the following code segment,

def _parse_date_mssql(dateString):
.........'zonediff': '+09:00'}

Tested against unit tests channel_pubDate_mssql*.xml

According to http://msdn.microsoft.com/en-us/library/bb677233.aspx
The date format is 'yyyy-mm-dd[ hh:mm:ss[.9999999][ plus/minus hh:mm]]' 
it could be any time zone. I guess GMT if there no [plus/minus].

Is there any unspoken convention that I'm missing?

Original issue reported on code.google.com by alanaz...@gmail.com on 5 Jan 2011 at 12:12

GoogleCodeExporter commented 9 years ago
No, you're correct. The hardcoded timezone appears to have simply been copied 
from the `onblog` code above (which is apparently specific to a Korean blog 
site, hence the specific timezone). It's also duplicated in the `nate` code as 
well. Amazingly, there are unit tests to verify this functionality, which leads 
me to believe whoever created this code ran a date through the function and 
simply copied the output into the unit test!

After the next release I'm going to work to revamp the unit tests so that dates 
and times are tested much more thoroughly than they currently are, and the link 
in this bug report will go a long way to make sure that mssql is correctly 
supported.

Original comment by kurtmckee on 5 Jan 2011 at 8:14

GoogleCodeExporter commented 9 years ago
@Ade: Would you set this to Accepted for the time being? I'll tackle it when I 
have a unit test framework in place that will allow much more fine-grained 
date/time testing.

Original comment by kurtmckee on 5 Jan 2011 at 8:17

GoogleCodeExporter commented 9 years ago

Original comment by adewale on 6 Jan 2011 at 3:48

GoogleCodeExporter commented 9 years ago

Original comment by kurtmckee on 19 Jan 2011 at 4:47

GoogleCodeExporter commented 9 years ago
Fixed in r581.

Original comment by kurtmckee on 6 Sep 2011 at 6:22