I wrote it using a single rung. Given the "OnHour" and the "OffHour", there are 3 situations that the comparisons for turning on the output are different.
1. When OnHour > OffHour, e.g. turn on at 8PM (OnHour is 20) and turn off at 8AM (OffHour is 8)
2. When OnHour < OffHour, e.g. turn on at 9AM (OnHour is 9) and turn off at 5PM (OffHour is 17)
3. When OnHour = OffHour, e.g. just turn it on during the "noon hour" from 12:00 to 12:59 (OnHour is 12, OffHour is 12)
See the attached rung.