date format c# dd/mm/yyyy code example
Example 1: 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"));
Example 2: c# date string format yyyy-mm-dd
public static string FORMAT_PDF = "dd/MM/yyyy";
public static string convertDateTimeFormatByStrDate(string strDate,string format)
{
DateTime temp = Convert.ToDateTime(strDate);
return temp.ToString(format);
}