display date time c# code example
Example 1: csharp datetime string format
DateTime.Now.ToString("MM/dd/yyyy HH:mm:ss")
Example 2: c# date
using System;
class Test {
static void Main() {
//print current datetime
Console.WriteLine (DateTime.Now.ToString());
//make a custom datetime
DateTime dt = new DateTime(2018, 7, 24);
Console.WriteLine (dt.ToString());
}
}