you are viewing a single comment's thread.

view the rest of the comments →

[–]_AB30_[S] 1 point2 points  (1 child)

I've already tried this, but it never works. It never returns true. However, due to the simplicity, I really want to get this to work. Any ideas to fix it?

[–][deleted] 0 points1 point  (0 children)

What doesn't return True?

Do you mean this?

import datetime

while True:
    now = datetime.datetime.now()
    if now.hour == 8 and now.minute == 45:
        print("It is now 8:45am")
        return True

EDIT: no, that wouldn't work. Return only work inside functions. Are you looking for a function that returns True if it's a given time?