RTC and millis

Use the time.h library with the rtc.

You're probably getting glitches because you're polling the rtc multiple times within a second.