I have a need to reverse a date to show as a "date code". For example
today, 090507 would be coded as 905070 (reversing the parts of the date.
This is what i have but there has to be a better way.
DateTime d = DateTime.Now;
string datecodemonth = d.ToString("MM" );
datecodemonth = datecodemonth[1] + datecodemonth[0];
string datecodeday = d.ToString("dd" );
datecodeday = datecodeday[1] + datecodeday[0];
string datecodeyear = d.ToString("yy" );
datecodeyear = datecodeyear[1] + datecodeyear[0];
string datecode = datecodemonth + datecodeday + datecodeyear;
Ideas? Is there anything in the format of the date that will do this?
dan