Arduino Clock: Setting Time

I saw this too and changed the second test in the if statement to:

previousMidnight(DateTime.now())+ alarmOffTime;

and it worked for me.