Mine is set up a bit odd because it’s like one step away from running all the lights.
If this is just one light you don’t need the last and switch logic, like this;
local light = script.Parent.Light
while task.wait(5) do
local t = game.Lighting.ClockTime
local mode = t >= 18 or t < 7
light.Enabled = mode
end