You could implement a server side validation that just does the check when you submit the form for the add to cart. You could also use an if statement to say:
if the current time is later than the cutoff time then
display your message
else
display your add to cart button
This is just high level of how you could do this, there are other ways you could implement this as well. I think having some sort of validation that does the check in addition to hiding the button would be the best bet in case the user submits the form some other way.