Date format in C#

Saratvaddilli
Posted by Saratvaddilli under C# category on | Points: 40 | Views : 1092
DateTime DateTimeDT = new DateTime(2012, 3, 9, 16, 5, 7, 123);

String.Format("{0:y yy yyy yyyy}", DateTimeDT );
String.Format("{0:M MM MMM MMMM}", DateTimeDT );
String.Format("{0:d dd ddd dddd}", DateTimeDT );
String.Format("{0:h hh H HH}", DateTimeDT );
String.Format("{0:m mm}", DateTimeDT );
String.Format("{0:s ss}", DateTimeDT );
String.Format("{0:f ff fff ffff}", DateTimeDT );
String.Format("{0:F FF FFF FFFF}", DateTimeDT );
String.Format("{0:t tt}", DateTimeDT );
String.Format("{0:z zz zzz}", DateTimeDT );

Comments or Responses

Login to post response