I am trying to implement a simple counter that will count the number of times a switch is turned on during a 24 hour, 5 day and 30 day period. I have created timer funtions for this, however, they dont seem to be having the desired result. For the 24 hour, I would like the timer to allow counting between midnights, and reset after every 24 hour. Similarly for the 5 day - monday thru friday. I have enclosed screen grabs for each case, can someone please tell me what I am doing wrong here, and also how to implement a 30 day timer. Any help is appreciated. Thanks.