Loop between a date of every month,

Thanks. I did check the example and found that the loop equates the current and former readings
"lastButtonState = buttonState;" but how can i use this info in my code? since for the whole 24hr my state would remain the same?