So I was trying to make a simple code using datetime and came across an error.
from datetime import datetime
x = True
b = datetime.strptime("06:10", "%H:%M")
while x == True:
a = datetime.now().time()
if a > b:
x = False
TypeError: unorderable types: datetime.time() > datetime.datetime()
When you call
datetime.now() you get actually a
datetime.datetime object. So you could already compare both values if you remote
.time(). An alternative would be (if you don't care about the date) that you actually get only the time of
b by doing
b = b.time().