For the alarm to trigger, the values you set up must match. So something you've set up for the 31 day will not go off unless the day is 31.
So it won't happen in the months of 30 only days.
But try it and see! Set the clock to a test time and date and watch what happens when midnight strikes. Midnight that becomes the 1st of the next month, then try a few seconds before a midnight date that would become the 31st day of the current month.
a7