date and time range checking

Maksim Kasimov kasimov at i.com.ua
Thu Jun 2 14:11:56 EDT 2005


there are few of a time periods, for example:
	2005-06-08 12:30 -> 2005-06-10 15:30,
	2005-06-12 12:30 -> 2005-06-14 15:30

and there is some date and time value:
	2005-06-11 12:30

what is the "pythonic" way to check is the date/time value in the given periods range?

something like xrange:
 >>> a = xrange(1,5)
 >>> b = 3
 >>> if b in a:
...     print "OK"


thanks

-- 
Best regards,
Maksim Kasimov
mailto: kasimov at i.com.ua



More information about the Python-list mailing list