Skip to content

Commit

Permalink
Merge pull request #1761 from nsoranzo/release_15.10_fix_for_1619
Browse files Browse the repository at this point in the history
[15.10] Fix pretty_print_time_interval for MySQL.
  • Loading branch information
blankenberg committed Feb 18, 2016
2 parents 476734d + ef93629 commit 6c83fbe
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/galaxy/util/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,11 @@ def pretty_print_time_interval( time=False, precise=False ):
elif isinstance( time, datetime ):
diff = now - time
elif isinstance( time, basestring ):
time = datetime.strptime( time, "%Y-%m-%dT%H:%M:%S.%f" )
try:
time = datetime.strptime( time, "%Y-%m-%dT%H:%M:%S.%f" )
except ValueError:
# MySQL may not support microseconds precision
time = datetime.strptime( time, "%Y-%m-%dT%H:%M:%S" )
diff = now - time
else:
diff = now - now
Expand Down

0 comments on commit 6c83fbe

Please sign in to comment.