It does not seem very efficient to constantly poll for the time. I suggest an event structure with a timeout.
Except for the first call, the timeout is the number of ms in a day. For the first iteration the timeout is the number of ms left until midnight.
Simply use a shift register for the timeout as in the attached example. It gets initialized with the time until midnight, then permanently gets the 1 day timeout.
(I haven't fully tested the demo, but you'll get the idea)