DateTime dt = DateTime.Now;
CultureInfo iv = CultureInfo.InvariantCulture;
// Default formats
// D - long date Tuesday, 24 April 2018
// d - short date 04/24/2018
// F - full date long Tuesday, 24 April 2018 06:30:00
// f - full date short Tuesday, 24 April 2018 06:30
// G - general long 04/24/2018 06:30:00
// g - general short 04/24/2018 06:30
// U - universal full Tuesday, 24 April 2018 06:30:00
// u - universal sortable 2018-04-24 06:30:00
// s - sortable 2018-04-24T06:30:00
// T - long time 06:30:00
// t - short time 06:30
// O - ISO 8601 2018-04-24T06:30:00.0000000
// R - RFC 1123 Tue, 24 Apr 2018 06:30:00 GMT
// M - month April 24
// Y - year month 2018 April
Console.WriteLine(dt.ToString("D", iv));
// Custom formats
// M/d/yy 4/8/18
// MM/dd/yyyy 04/08/2018
// yy-MM-dd 08-04-18
// yy-MMM-dd ddd 08-Apr-18 Sun
// yyyy-M-d dddd 2018-4-8 Sunday
// yyyy MMMM dd 2018 April 08
// h:mm:ss tt zzz 4:03:05 PM -03
// HH:m:s tt zzz 16:03:05 -03:00
// hh:mm:ss t z 04:03:05 P -03
// HH:mm:ss tt zz 16:03:05 PM -03
Console.WriteLine(dt.ToString("M/d/yy", iv));