In Minecraft I wanted to build something that fires a rocket at 18,000 tick time at midnight, but the daylight sensor stops giving a signal from 13670 and the night sensor does not give any exact signals at midnight.
I tried to delay 4330 ticks after the daylight sensor goes out, but I only built a circuit that does not reset, it should work automatically every night and not just once
You could combine it with a score:
/ scoreboard objectives add (name) dummy
/ execute store result (name of score + person) run time query
/ Exute if entity (name, or: @e [scores = {(name of the score) = 18000}]
This works with repeat command blocks, so cheats must be on
If you have certain questions, just ask.
Hope I could help