//try following public static void Main() { //first date DateTime dt1=DateTime.Parse("05/05/2005"); //second date DateTime dt2=DateTime.Now; //Subtact dates TimeSpan ts =dt2.Subtract(dt1); //result. Console.WriteLine(ts.Days); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)