Elapsed Time resetting every 12 A.M

Hi, I need some help. I am trying to find a way for an elapsed time that resets my variable at a specific time on a day which is 12 A.M is there any way to do this because I only know where the elapsed time resets my variables by the last saved time. Like this

This method only resets after 24 hours when the reward is claimed… But I want it to reset when the clock hits 12 A.M

It would be greatly appreciated

I dont have solution however i might be able to take this n turn it into like my game wheres its kinda like offline time base game

Wouldn’t changing your 3rd condition to 12 from 24 solve your problem?