I have been tasked with finding the time difference between two times. The first is the "current time" as defined by the variables and the second a "deadline" also defined by variables.
Getting the code to return the variables in the time formats I want is fine, however there are two variables, one for each side. The string form of "AM"and "PM".
current_hour = 12
current_minute = 37
current_section = "PM"
due_hour = 9
due_minute = 0
due_section = "PM"
import datetime
current_time = datetime.datetime(2020,1,1) + datetime.timedelta(0,0,0,0,current_minute,current_hour)
current_time = (current_time.strftime("%I:%M" + current_section))
deadline = datetime.datetime(2020,1,1) + datetime.timedelta(0,0,0,0,due_minute,due_hour)
deadline = deadline.strftime("%I:%M" + due_section)
if current_time <= deadline:
print(True)
else:
current_time > deadline
print(False)