If logic for action using multiple entities and time

I was wondering if this is possible or I need to create 3 separate automation.

I was looking to turn the island lights on from motion from early morning like 7am-9am
Looking to turn over head lights from 9am-5pm
Looking to turn on island lights and overhead lights from 5-midnight
- switch.island_light
- kitchen_overhead_light

Is there an easy way to manipulate time?

Is this possible to do this with a service template?