In any case you need to store information about "button clicked" event occur. And then check it every time before page is loading.
There is so many ways you can do it.
For example, if you storing data in mysql table button_click_events, then you can count days passed from event by MySQL query:
SELECT DATEDIFF (CURDATE(), button_click_events.event_date);
Btw, you're asking very unspecified question, that's hard to answer without context.