using System; class Sample { public static void Main() { Console.WriteLine("(F) Full date/long time:. . . {0:F} ",DateTime.Now); } }
Author: coder
General date/short time format
using System; class Sample { public static void Main() { Console.WriteLine( "(g) General date/short time:. {0:g} ",DateTime.Now); } }
General date long time format
using System; class Sample { public static void Main() { Console.WriteLine("(G) General date/long time: . {0:G} ",DateTime.Now); } }
Year date format
using System; class Sample { public static void Main() { Console.WriteLine("(Y) Year: . . . . . . . . . . {0:Y} ",DateTime.Now); } }
Month date format
using System; class Sample { public static void Main() { Console.WriteLine("(M) Month:. . . . . . . . . . {0:M} ",DateTime.Now); } }
RFC1123 date format
using System; class Sample { public static void Main() { Console.WriteLine("(R) RFC1123:. . . . . . . . . {0:R} ",DateTime.Now); } }
Universal full date/time
using System; class Sample { public static void Main() { Console.WriteLine("(U) Universal full date/time: {0:U} ",DateTime.Now); } }