I have set alarm 1 and 2 with different time on my ds3231 and I want to see which alarm will trigger first. how can I compare the time in HH:MM format? as far as I know its a structure and I dont know if it can be compared as one single entity. is there any function to do it?
I dont want to compare hour and minute separately.
A DateTime is a full class with lots of methods to it - a time_t is just an unsigned long. time_t is used to store the number of seconds since the epoch (normally 01/01/1970) The Arduino Time library returns a time_t to the now() function - but RTCLib return s a DateTime object. The DateTime object, though, has a unixtime() method which will return a time_t representation of the time stored in the DateTime object. So you can do:
DateTime dt = RTC.now();
time_t time = dt.unixtime();