Re: date and time range checking

2005-06-02 Thread Andrew Dalke
Maksim Kasimov wrote: > 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 th

Re: date and time range checking

2005-06-02 Thread Peter Hansen
Maksim Kasimov wrote: > what is the "pythonic" way to check is the date/time value in the given > periods range? Something like this, though I won't make strong claims of "pythonicness". If you want to use the "in" keyword you'll want a custom class and overriding of __contains__. import time

date and time range checking

2005-06-02 Thread Maksim Kasimov
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? someth