You are on page 1of 1

How to Display Date in Reverse Format in C#

Sometimes we need to play with date and we need to display date in reverse format. So I am here
with a C# code research.

This example is for today’s date while you can change this code to display any date in reverse
format.

private string ReversedDateString( )


{
string reversedDate;

// year component
reversedDate = DateTime.Now.Year.ToString().Substring( 2, 2 );

// month component
reversedDate += DateTime.Now.Month.ToString( "00" );

// day component
reversedDate += DateTime.Now.Day.ToString( "00" );

return reversedDate;
}

You might also like