mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-11 23:18:22 +08:00
Add: Timezone aware
- Fix mat withdraw on slow device
This commit is contained in:
@@ -23,7 +23,7 @@ def future_time(string):
|
||||
string (str): Such as 14:59.
|
||||
|
||||
Returns:
|
||||
datetime.datetime: Time with given hour, minute, second in the future.
|
||||
datetime.datetime: Time with given hour, minute in the future.
|
||||
"""
|
||||
hour, minute = [int(x) for x in string.split(':')]
|
||||
future = datetime.now().replace(hour=hour, minute=minute, second=0, microsecond=0)
|
||||
@@ -31,6 +31,20 @@ def future_time(string):
|
||||
return future
|
||||
|
||||
|
||||
def past_time(string):
|
||||
"""
|
||||
Args:
|
||||
string (str): Such as 14:59.
|
||||
|
||||
Returns:
|
||||
datetime.datetime: Time with given hour, minute in the past.
|
||||
"""
|
||||
hour, minute = [int(x) for x in string.split(':')]
|
||||
past = datetime.now().replace(hour=hour, minute=minute, second=0, microsecond=0)
|
||||
past = past - timedelta(days=1) if past > datetime.now() else past
|
||||
return past
|
||||
|
||||
|
||||
def future_time_range(string):
|
||||
"""
|
||||
Args:
|
||||
|
||||
Reference in New Issue
Block a user