using System; class Sample { public static void Main() { Console.WriteLine("(f) Full date/short time: . . {0:f} ",DateTime.Now); } }
Full date long time format
using System; class Sample { public static void Main() { Console.WriteLine("(F) Full date/long time:. . . {0:F} ",DateTime.Now); } }
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); } }