CSharp examples for Language Basics:Date Time
Create DateTime type variable
using System;//from w ww.j a va 2 s. c om using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; class Program { static void Main(string[] args) { // Variable of DateTime type, at first empty DateTime now; // Storing of current date and time into our variable now = DateTime.Now; // Output Console.WriteLine("Now is " + now); } }