How can I increment a variable at Midnight

I think a logcat session might reveal what is happening: