Checking for multiple values in IF separated by commata
Yes, the list of values 4, 6, 9, 11 does not mean what you think it does.

if ((minute == 31) &amp;&amp;  ((hour == 4) || (hour == 6) || (hour == 9) || (hour == 11))) {
    digitalWrite(8, HIGH);
}