diff --git a/src/COMDIRAC/Interfaces/scripts/dinput.py b/src/COMDIRAC/Interfaces/scripts/dinput.py index b64e158..96f0a3c 100644 --- a/src/COMDIRAC/Interfaces/scripts/dinput.py +++ b/src/COMDIRAC/Interfaces/scripts/dinput.py @@ -1,11 +1,13 @@ """ Retrieve input sandbox for a DIRAC job """ + import DIRAC from DIRAC.Core.Base.Script import Script import os import pprint +import datetime class Params: @@ -89,7 +91,7 @@ def main(): jobIDs = Script.getPositionalArgs() from DIRAC.Interfaces.API.Dirac import Dirac - from DIRAC.Core.Utilities.Time import toString, date, day + from DIRAC.Core.Utilities.TimeUtilities import toString, day dirac = Dirac() exitCode = 0 @@ -107,7 +109,7 @@ def main(): jobIDs += l.split(",") for jobGroup in params.getJobGroup(): - jobDate = toString(date() - 30 * day) + jobDate = toString(datetime.datetime.utcnow().date - 30 * day) # Choose jobs no more than 30 days old result = dirac.selectJobs(jobGroup=jobGroup, date=jobDate) diff --git a/src/COMDIRAC/Interfaces/scripts/doutput.py b/src/COMDIRAC/Interfaces/scripts/doutput.py index 50088d9..c8aed07 100644 --- a/src/COMDIRAC/Interfaces/scripts/doutput.py +++ b/src/COMDIRAC/Interfaces/scripts/doutput.py @@ -7,6 +7,7 @@ from DIRAC.Core.Base.Script import Script import os +import datetime class Params: @@ -107,7 +108,7 @@ def main(): args = Script.getPositionalArgs() from DIRAC.Interfaces.API.Dirac import Dirac - from DIRAC.Core.Utilities.Time import toString, date, day + from DIRAC.Core.Utilities.TimeUtilities import toString, day dirac = Dirac() exitCode = 0 @@ -125,7 +126,7 @@ def main(): args += l.split(",") for jobGroup in params.getJobGroup(): - jobDate = toString(date() - 30 * day) + jobDate = toString(datetime.datetime.utcnow().date() - 30 * day) # Choose jobs in final state, no more than 30 days old for s in ["Done", "Failed"]: diff --git a/src/COMDIRAC/Interfaces/scripts/dstat.py b/src/COMDIRAC/Interfaces/scripts/dstat.py index b1b1a38..15ac997 100644 --- a/src/COMDIRAC/Interfaces/scripts/dstat.py +++ b/src/COMDIRAC/Interfaces/scripts/dstat.py @@ -2,6 +2,7 @@ """ Retrieve status of DIRAC jobs """ +import datetime from signal import signal, SIGPIPE, SIG_DFL from DIRAC import exit as DIRACExit, S_OK, S_ERROR @@ -232,7 +233,9 @@ def main(): if not jobs: # time interval - jobDate = toString(date() - params.getJobDate() * day) + jobDate = toString( + datetime.datetime.utcnow().date() - params.getJobDate() * day + ) # job owner userName = params.getUser()