Check if time is between two time inputs.

Convert all times to seconds past midnight and the comparisons become trivial.

   if (time_in_seconds >= on_time && time_in_seconds < off_time) lights_on();
   else lights_off();