How do I check if a given datetime object is "between" two datetimes?

Posted by alex on Stack Overflow See other posts from Stack Overflow or by alex
Published on 2010-04-14T00:26:23Z Indexed on 2010/04/14 0:33 UTC
Read the original article Hit count: 258

Filed under:
|
|
|
my_event = Event.objects.get(id=4)
current_time = datetime.datetime.now()

How do I do check if my current time is between them?

my_event.start_time < current_time < my_event.end_time

© Stack Overflow or respective owner

Related posts about django

Related posts about python