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();
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();