diff --git a/pynyaata/utils.py b/pynyaata/utils.py index e09b6e4..b36738f 100644 --- a/pynyaata/utils.py +++ b/pynyaata/utils.py @@ -15,15 +15,17 @@ def link_exist_in_db(href): def parse_date(str_to_parse, date_format=''): if str_to_parse is None: - return datetime.fromtimestamp(0) + date_to_format = datetime.fromtimestamp(0) elif isinstance(str_to_parse, datetime): - return str_to_parse + date_to_format = str_to_parse else: date = parse(str_to_parse, date_formats=[date_format]) if date: - return date.isoformat(' ', 'minutes') + date_to_format = date else: - return datetime.fromtimestamp(0).isoformat(' ', 'minutes') + date_to_format = datetime.fromtimestamp(0) + + return date_to_format.isoformat(' ', 'minutes') def boldify(str_to_replace, keyword):