DateTime.ToString(String format)
using System;
class MainClass
{
public static void Main()
{
DateTime myDateTime = new DateTime(2004, 1, 12, 22, 2, 10);
Console.WriteLine("myDateTime.ToString() = " + myDateTime.ToString());
Console.WriteLine("myDateTime.ToString(\"MMMM dd, yyyy\") = " + myDateTime.ToString("MMMM dd, yyyy"));
}
}
Related examples in the same category