Temp logging
This commit is contained in:
parent
7fcd1d844b
commit
85859fb8d1
@ -2,25 +2,32 @@ from datetime import time, datetime, timedelta
|
|||||||
|
|
||||||
def is_working_hours(date = datetime.now()):
|
def is_working_hours(date = datetime.now()):
|
||||||
if date.weekday() >= 5:
|
if date.weekday() >= 5:
|
||||||
|
print("Its the weekend")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
start = time(8, 0, 0)
|
start = time(8, 0, 0)
|
||||||
end = time(18, 0, 0)
|
end = time(18, 0, 0)
|
||||||
|
|
||||||
current_time = date.time()
|
current_time = date.time()
|
||||||
|
print(f"Current {current_time}")
|
||||||
return start <= current_time <= end
|
return start <= current_time <= end
|
||||||
|
|
||||||
def potential_midday_upload(date = datetime.now()):
|
def potential_midday_upload(date = datetime.now()):
|
||||||
if date.weekday() >= 5:
|
if date.weekday() >= 5:
|
||||||
|
print("Its the weekend")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
midday_upload_time = time(14, 0, 0)
|
midday_upload_time = time(14, 0, 0)
|
||||||
|
|
||||||
current_time = date.time()
|
current_time = date.time()
|
||||||
|
|
||||||
|
print(f"Current {current_time} : {midday_upload_time}")
|
||||||
|
|
||||||
return midday_upload_time <= current_time
|
return midday_upload_time <= current_time
|
||||||
|
|
||||||
def next_working_hour(date = datetime.now()):
|
def next_working_hour(date = datetime.now()):
|
||||||
if is_working_hours(date):
|
if is_working_hours(date):
|
||||||
|
print("Its already working hour")
|
||||||
return date
|
return date
|
||||||
|
|
||||||
potential_start = date.replace(hour=8, minute=0, second=0, microsecond=0)
|
potential_start = date.replace(hour=8, minute=0, second=0, microsecond=0)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user