1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-12 02:48:23 +08:00

Fix: Timezone calculation (fixed #1253)

This commit is contained in:
LmeSzinc
2022-06-24 02:55:17 +08:00
parent ae59cc7fee
commit 5bae649009

View File

@@ -481,8 +481,8 @@ def get_server_next_update(daily_trigger):
for t in daily_trigger:
h, m = [int(x) for x in t.split(':')]
future = local_now.replace(hour=h, minute=m, second=0, microsecond=0) + diff
future = future + timedelta(days=1) if future < local_now else future
future = future + timedelta(days=1) if future < local_now else future
s = (future - local_now).total_seconds() % 86400
future = local_now + timedelta(seconds=s)
trigger.append(future)
update = sorted(trigger)[0]
return update
@@ -505,10 +505,10 @@ def get_server_last_update(daily_trigger):
for t in daily_trigger:
h, m = [int(x) for x in t.split(':')]
future = local_now.replace(hour=h, minute=m, second=0, microsecond=0) + diff
future = future - timedelta(days=1) if future > local_now else future
future = future - timedelta(days=1) if future > local_now else future
s = (future - local_now).total_seconds() % 86400 - 86400
future = local_now + timedelta(seconds=s)
trigger.append(future)
update = sorted(trigger)[0]
update = sorted(trigger)[-1]
return update