How to use time in if statements

Hi there!

I have never used strings in Arduino before so forgive me if I say something wrong.

With string elements, a simple "==" command does not always work as intended, and some setup is needed before it will operate correctly. To compare two strings, the strings must be set up properly, like shown below.

stringTime = String("20:00:00");

stringRTC = rtc.getTimeStr; //Assuming this command returns a string

if(stringTime == stringRTC)
{

}

Try this and see if it works