Dec-28-2018, 03:55 PM
I want to monitor an event's and store value in counter and when the day turns over, it resets the counter to zero.
Here is a example
Day: 28 Count: 0
Day: 28 Count: 1
Day: 28 Count: 2
... .....
Day: 28 Count: 123
Day: 29 Count: 0
Day: 29 Count: 1
Day: 29 Count: 2
Day: 29 Count: 3
... ... ...
Day: 29 Count: 565
Day: 30 Count: 0
Day: 26 Count: 1
Day 28 have 123 entries because the next day 29 started after the 28 turned over.
Day 29 have 565 entries because the next day 30 started after the 29 turned over.
any idea how to make script
Here is a example
Day: 28 Count: 0
Day: 28 Count: 1
Day: 28 Count: 2
... .....
Day: 28 Count: 123
Day: 29 Count: 0
Day: 29 Count: 1
Day: 29 Count: 2
Day: 29 Count: 3
... ... ...
Day: 29 Count: 565
Day: 30 Count: 0
Day: 26 Count: 1
Day 28 have 123 entries because the next day 29 started after the 28 turned over.
Day 29 have 565 entries because the next day 30 started after the 29 turned over.
any idea how to make script
import time import datetime count = 0 now = datetime.datetime.now()