I have this so far, I know I'm missing the checking part but I don't know how to do it, I'm new to scripting.
function timeFix()
if game.Lighting.TimeOfDay >= "00:00:00" and game.Lighting.TimeOfDay <= "06:00:00"
or game.Lighting.TimeOfDay >= "18:00:00"
then script.Parent.Enabled = true
else
script.Parent.Enabled = false
end
end
The parent is a spotlight, the rest is pretty self explanatory.

4 comments
Silly mistake. I forgot a space. Edited.
How can I get it to automatically update itself? At the moment it doesn't turn off automatically when it becomes dark.
Added it to my answer.
You're the best. Thanks.