Open thanh-lam opened 3 years ago
To fix the date+time format in the script, modify the two lines: Replace the blank between date and time with the letter T.
date_format= '%Y-%m-%dT%H:%M:%S.%f'
...
start_time=datetime.strptime(tr_data["begin_time"], '%Y-%m-%dT%H:%M:%S.%f')
Found another script that also has similar date+time format hard coded: findJobKeys.py
:
date_format= '%Y-%m-%d %H:%M:%S.%f'
That needs to be modified similarly:
date_format= '%Y-%m-%dT%H:%M:%S.%f'
A 3rd script that uses old date+time format that needs to be corrected: findJobMetrics.py
from datetime import datetime
date_format= '%Y-%m-%d %H:%M:%S.%f'
start_time=datetime.strptime(allocation.get("begin_time"), date_format)
end_time=datetime.strptime(allocation.get("history").get("end_time"), date_format)
Describe the bug The python script
findJobTimeRange.py
displaysbegin_time
,history.end_time
, and related info for an allocation. As described in #992, the date+time format is required to be updated to "yyyy-MM-ddThh:mm:ss.SSSZ". The problem is thatfindJobTimeRange.py
defined this date format based on the old date string "yyyy-MM-dd hh:mm:ss.SSSZ". This caused a failure:To Reproduce Steps to reproduce the behavior:
Expected behavior Example of a successful run:
Environment (please complete the following information):
Additional context Following two lines in findJobTimeRange.py are where date format is defined.
Issue Source: Because the date format is "hard coded" in the script. It required to be changed every time the date+time format is changed.