mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2026-04-05 09:41:56 -07:00
BE+FE: refactor timezone UTC additional work #1506
Signed-off-by: jokob-sk <jokob.sk@gmail.com>
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
from logger import mylog
|
from logger import mylog
|
||||||
from utils.datetime_utils import timeNowUTC
|
from utils.datetime_utils import timeNowTZ
|
||||||
|
|
||||||
|
|
||||||
# -------------------------------------------------------------------------------
|
# -------------------------------------------------------------------------------
|
||||||
@@ -28,11 +28,11 @@ class schedule_class:
|
|||||||
# Initialize the last run time if never run before
|
# Initialize the last run time if never run before
|
||||||
if self.last_run == 0:
|
if self.last_run == 0:
|
||||||
self.last_run = (
|
self.last_run = (
|
||||||
timeNowUTC(as_string=False) - datetime.timedelta(days=365)
|
timeNowTZ(as_string=False) - datetime.timedelta(days=365)
|
||||||
).replace(microsecond=0)
|
).replace(microsecond=0)
|
||||||
|
|
||||||
# get the current time with the currently specified timezone
|
# get the current time with the currently specified timezone
|
||||||
nowTime = timeNowUTC(as_string=False)
|
nowTime = timeNowTZ(as_string=False)
|
||||||
|
|
||||||
# Run the schedule if the current time is past the schedule time we saved last time and
|
# Run the schedule if the current time is past the schedule time we saved last time and
|
||||||
# (maybe the following check is unnecessary)
|
# (maybe the following check is unnecessary)
|
||||||
|
|||||||
Reference in New Issue
Block a user