This code simply ensures (but not the best way) that month and day numbers will be 2 characters-long.
But that is silly. Day and month should be integers, not strings; and displaying an integer with a given number of digits is done this way:
string dayString = day.ToString("D2");
string monthString = month.ToString("D2");
Using string type instead of the correct type is seen very often these days, unfortunately; that is a terrible habit that should be fought as soon as possible.
Hope this helps.