1 2 3 4
public static string DateTimeToyyyymmdd(DateTime dateTime) { return dateTime.ToString("yyyyMMdd"); }