I've got a time/date in the form of a tm struct and was wondering what's the best way to format it into a string of the format "MM/DD/YYYY HH:MM:SS". If I try to do sprintf or string.Format that doesn't work with single digit numbers.
I know I could just do a bunch of if statements but does anyone know of a better way?
After this is done, chDate is, for example, " 7/29/ ", not setting the month to "07" like the function is supposed to do and ignoring the year completely, even though debugging shows that all the data is in the tm pointer correctly.