Skip to content
This repository has been archived by the owner on May 4, 2024. It is now read-only.

Commit

Permalink
Fix "Error with time data"
Browse files Browse the repository at this point in the history
Automatically and silently default to 1900 when an invalid date is encountered.
Resolves some-programs#70
  • Loading branch information
ILAsoft committed Oct 6, 2017
1 parent ff95318 commit 27f03a5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions exitwp.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,9 @@ def gi(q, unicode_wrap=True, empty=False):

def format_date(date_text,date_format):
try:
datetime.strptime(date_text, date_format)
return datetime.strptime(date_text, date_format)
except ValueError:
'None'
return datetime.strptime("1900-01-01 00:00:00", date_format)

def write_jekyll(data, target_format):

Expand Down

0 comments on commit 27f03a5

Please sign in to comment.