-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_time.py
29 lines (20 loc) · 906 Bytes
/
test_time.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from datetime import datetime, timedelta
from copy import deepcopy
def times():
times_reajuste_1 = []
time_between = timedelta(hours=1, minutes=30)
for day_extra in range(0, 2):
time_base = datetime(2021, 8, 10 + day_extra, 8, 00, 00)
for banner in range(1, 9):
time = deepcopy(time_base)
start_time = time + time_between * (banner - 1)
end_time = time + time_between * banner - timedelta(minutes=10)
times_reajuste_1.extend([start_time, end_time])
times_reajuste_2 = []
time_base = datetime(2021, 8, 13, 8, 00, 00)
for banner in range(1, 9):
time = deepcopy(time_base)
start_time = time + time_between * (banner - 1)
end_time = time + time_between * banner - timedelta(minutes=10)
times_reajuste_2.extend([start_time, end_time])
return times_reajuste_1 + times_reajuste_2