reduce number of Serial.print

dataFile << "" << "Localtime: " << localtimeA << ":" << "0" << localtimeB << "\n" << endl;
What's that highlighted part doing?

I couldn't figure out how the sprintf works for the time to ad a 0, but i solved is with a if.

%d is the format specifier for an int. %2d says print the int using no less than 2 characters - the leading one can be a space. %02d says print the int using no less than 2 characters - the leading one will be a 0 if the value is less than 10.