Arduino skipping lines of code??

Arduino seems to be skipping lines of code?

Background: I have a data logger sketch using a RTC/Data Card and LCD keypad and display. It has been working perfectly for many months. All of a sudden the dates and times started showing erroneously.

I have gone back through the code and find no logic fault. In trouble shooting I have found that the Arduino seems to be skipping lines of code.

You can see from the highlighted snippet attached the program is in a loop that prints "I'm here", and then reads the time & date from the RTC, then print the date "21319". Most of the time it does but as you can see from the monitor sometimes it skips a few commands ??? How can this be?

Very simple. It can't. You're barking up the wrong tree.

Regards,
Ray L.

If I'm reading the right library GetMonth/Day/Year all return a byte. Why don't you ditch the use of String objects and try something like:

char
    szStr[20];

.
.
.
    
    sprintf( szStr, "%02d/%02d/%02d",
        HCRTC.GetDay(),
        HCRTC.GetMonth(),
        HCRTC.GetYear() );

    Serial.print( szStr );

.
.
.