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

Commit

Permalink
fix an issue while converting strings to datetime (with symbol -)
Browse files Browse the repository at this point in the history
  • Loading branch information
sdpython committed Mar 30, 2014
1 parent d8790ac commit 91f8b43
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/pyquickhelper/loghelper/convert_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def str_to_datetime (dt, format = None):
@rtype datetime
"""
if "+" in dt : dt = dt.split("+")[0].strip()
elif " -" in dt : dt = dt.split(" -")[0].strip()
if format == None :
if "." in dt :
return datetime.datetime.strptime (dt, "%Y-%m-%d %H:%M:%S.%f")
Expand Down

0 comments on commit 91f8b43

Please sign in to comment.