diff --git a/oxweb/imdb.py b/oxweb/imdb.py index 9591d05..cde4335 100644 --- a/oxweb/imdb.py +++ b/oxweb/imdb.py @@ -372,12 +372,17 @@ def getMovieReleaseDate(imdbId): return first_release def _parseDate(d): + ''' + >>>_parseDate('3 March 1972') + '1972-03-03' + ''' try: parsed_date = time.strptime(d, "%d %B %Y") parsed_date = '%s-%02d-%02d' % (parsed_date.tm_year, parsed_date.tm_mon, parsed_date.tm_mday) - parsed_date = time.strftime('%Y-%m-%d', parsed_date) return parsed_date except: + import traceback + traceback.print_exc() try: parsed_date = time.strptime(d, "%B %Y") parsed_date = '%s-%02d-01' % (parsed_date.tm_year, parsed_date.tm_mon)