Timer Tag error whenever a new day begins


I have done a logic in which timer tag (will extract the minute of the current time stamp) and it will trigger another boolean tag by setting it as one. Once the 'value changed' function in boolean tag is completed, it will be reset as false. This will be executed for every minute. Also i am capturing the time stamp in another tag (OEE Time) whenever the boolean tag is executed .It is working until the current time stamp is 12:00:00. After 12, it is not unchecking the boolean tag,

Timer tag (value changed):

def valueChanged(tag, tagPath, previousValue, currentValue, initialChange, missedEvents):
	if ( previousValue.value != currentValue.value ):
		logger = system.util.getLogger("OEE Timer Minute")
		system.tag.writeBlocking("[.]DBDataStoreTrigger", [1])
		logger.info("Minute Triggered")

Kindly help in resolving the issue.
Thanks in advance

Could you format all the code in your question as code? Hit the 🖉 edit link and then select the whole block of code and press the </> button to format it. It will preserve indentation and apply syntax highlighting. Thanks.

Please check the code now.

If this is logging every minute, why not take the script in the DBDatastoreTrigger tag and run it in the Timer tag? Seems overly complex.