mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Merge pull request #1761 from nsoranzo/release_15.10_fix_for_1619
[15.10] Fix pretty_print_time_interval for MySQL.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user