Browse Source

[Update] 修改任务执行日期显示本地时间

pull/3818/head
Michael Bai 5 years ago
parent
commit
55c7e06185
  1. 4
      apps/ops/models/adhoc.py

4
apps/ops/models/adhoc.py

@ -278,7 +278,7 @@ class AdHocExecution(OrgModelMixin):
raw = ''
try:
date_start_s = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
date_start_s = timezone.now().now().strftime('%Y-%m-%d %H:%M:%S')
print(_("{} Start task: {}").format(date_start_s, self.task.name))
raw, summary = self.start_runner()
except Exception as e:
@ -286,7 +286,7 @@ class AdHocExecution(OrgModelMixin):
raw = {"dark": {"all": str(e)}, "contacted": []}
finally:
self.clean_up(summary, time_start)
date_end = timezone.now()
date_end = timezone.now().now()
date_end_s = date_end.strftime('%Y-%m-%d %H:%M:%S')
print(_("{} Task finish").format(date_end_s))
print('.\n\n.')

Loading…
Cancel
Save