How to use time in if statements

By far the easiest way to do this is to use the Arduino time library (TimeLib.h), which internally keeps track of time in seconds since Jan 1, 1970.

If you are going to use the TimeLib.h, I strongly recommend that you change the rtc library used to Jack Christensens DS3232RTC. This library works with the DS3231 as well.

It is available through the library manager, is designed to integrate with the Time Library, works for all the functions of the DS3231, is bug free, and in my experience is the best library to use with the DS3231. The syntax is the same as the very commonly used basic DS1307 library by Margolis and sketches are cross compatible.