Commit 983a4aaf authored by zhengjinlei's avatar zhengjinlei

处理时间格式

parent f356c3df
...@@ -55,8 +55,8 @@ def get_inspect_rule(task): ...@@ -55,8 +55,8 @@ def get_inspect_rule(task):
def get_remain(check): def get_remain(check):
remain = 0 remain = 0
if check['startTime'] and check['closeTime']: if check['startTime'] and check['closeTime']:
start = datetime.strptime(check['startTime'], '%Y-%m-%d %H:%M:%S').timestamp() start = datetime.strptime(check['startTime'].replace('.0', ''), '%Y-%m-%d %H:%M:%S').timestamp()
close = datetime.strptime(check['closeTime'], '%Y-%m-%d %H:%M:%S').timestamp() close = datetime.strptime(check['closeTime'].replace('.0', ''), '%Y-%m-%d %H:%M:%S').timestamp()
remain = int(close - start) remain = int(close - start)
return remain return remain
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment