Example 1: c# date formats custom
DateTime dt = new DateTime(2008, 3, 9, 16, 5, 7, 123);
String.Format("{0:y yy yyy yyyy}", dt);
String.Format("{0:M MM MMM MMMM}", dt);
String.Format("{0:d dd ddd dddd}", dt);
String.Format("{0:h hh H HH}", dt);
String.Format("{0:m mm}", dt);
String.Format("{0:s ss}", dt);
String.Format("{0:f ff fff ffff}", dt);
String.Format("{0:F FF FFF FFFF}", dt);
String.Format("{0:t tt}", dt);
String.Format("{0:z zz zzz}", dt);
String.Format("{0:M/d/yyyy}", dt);
String.Format("{0:MM/dd/yyyy}", dt);
String.Format("{0:ddd, MMM d, yyyy}", dt);
String.Format("{0:dddd, MMMM d, yyyy}", dt);
String.Format("{0:MM/dd/yy}", dt);
String.Format("{0:MM/dd/yyyy}", dt);
Example 2: c# date format
DateTime dt = new DateTime(2008, 3, 9, 16, 5, 7, 123);
String.Format("{0:y yy yyy yyyy}", dt);
String.Format("{0:M MM MMM MMMM}", dt);
String.Format("{0:d dd ddd dddd}", dt);
String.Format("{0:h hh H HH}", dt);
String.Format("{0:m mm}", dt);
String.Format("{0:s ss}", dt);
String.Format("{0:f ff fff ffff}", dt);
String.Format("{0:F FF FFF FFFF}", dt);
String.Format("{0:t tt}", dt);
String.Format("{0:z zz zzz}", dt);
Example 3: c# parse the date in DD/MMM/YYYY format
CultureInfo culture = new CultureInfo("es-ES");
String myDate = "15/05/2018";
DateTime date = DateTime.Parse(myDate,culture);
Console.WriteLine(date.ToString("dd/MMM/yyyy"));