How to use time in if statements

willman:
Hey
I have a DS3231 time module and I want to make events happen based upon the time, but it can't read it as a variable and doesn't work. "invalid use of member function"

if (rtc.getTimeStr == 20:00:00){
}
thanks

Just guessing, but two things look sus. First, the syntax of the function call should be

rtc.getTimeStr()

Note the brackets.

Second, it looks like rtc.getTimeStr should return a string, so the comparison would look like this

if(rtc.getTimeStr() == "20:00:00"){}

Note the quotes.

Pogo