# WARNING -- it's left to the reader to properly compare the values (can't do '01:40' < '01:30') if start <= end return 1 if start <= t and t <= end else # end < start return 1 if ( start <= t and t <= 23:59 ) or ( 00:00 <= t and t <= end ) endif