Hi,
In datetime.datetime, the utcnow() & utcfromtimestamp() functions are deprecated from python3.12: The replacements for these have been available for a long time, so I suggest tidying them up. There are a few other linked smaller tasks:
- There are a few uses of strftime("%s") which has better alternatives.
|
NO_LATER_THAN_2050_IN_SEC = int((datetime.strptime("2049-12-31", "%Y-%M-%d") - datetime.now()).total_seconds()) |
The %M specifier is minutes, not months, so it's off by ~11 months.
- There are some uses of
datetime.now(), which may well run into issues around daylight-savings changes. These should all be checked and probably converted to UTC or another timezone aware option.
I'm thinking this could be a task for @martynia ?
Regards,
Simon
Hi,
In
datetime.datetime, theutcnow()&utcfromtimestamp()functions are deprecated from python3.12: The replacements for these have been available for a long time, so I suggest tidying them up. There are a few other linked smaller tasks:DIRAC/src/DIRAC/Core/Security/test/Test_X509Chain.py
Line 64 in 48c1170
datetime.now(), which may well run into issues around daylight-savings changes. These should all be checked and probably converted to UTC or another timezone aware option.I'm thinking this could be a task for @martynia ?
Regards,
Simon