@@ -128,6 +128,10 @@ class ScheduleGenerator:
|
|||||||
|
|
||||||
def _time_diff(self, time1: str, time2: str) -> int:
|
def _time_diff(self, time1: str, time2: str) -> int:
|
||||||
"""计算两个时间字符串之间的分钟差"""
|
"""计算两个时间字符串之间的分钟差"""
|
||||||
|
if time1=="24:00":
|
||||||
|
time1="23:59"
|
||||||
|
if time2=="24:00":
|
||||||
|
time2="23:59"
|
||||||
t1 = datetime.datetime.strptime(time1, "%H:%M")
|
t1 = datetime.datetime.strptime(time1, "%H:%M")
|
||||||
t2 = datetime.datetime.strptime(time2, "%H:%M")
|
t2 = datetime.datetime.strptime(time2, "%H:%M")
|
||||||
diff = int((t2 - t1).total_seconds() / 60)
|
diff = int((t2 - t1).total_seconds() / 60)
|
||||||
@@ -165,4 +169,4 @@ class ScheduleGenerator:
|
|||||||
# if __name__ == "__main__":
|
# if __name__ == "__main__":
|
||||||
# main()
|
# main()
|
||||||
|
|
||||||
bot_schedule = ScheduleGenerator()
|
bot_schedule = ScheduleGenerator()
|
||||||
|
|||||||
Reference in New Issue
Block a user