CSharp examples for Language Basics:Date Time
Get today's date
using System;//from w ww . j a va 2 s . co m 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 today; // Storing of today's date (without time component) today = DateTime.Today; // Output Console.WriteLine("Today is " + today); } }