mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-12 00:28:20 +08:00
Fix: Timezone calculation (fixed #1253)
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user