DateTime startDate = DateTime.Now.AddDays(-25); DateTime endDate = DateTime.Now; TimeSpan difference = endDate.Subtract(startDate); Console.WriteLine(difference.Days);
DateTime.Subtract(DateTime)
DateTime christmas = new DateTime(2011, 10, 10); DateTime newYears = new DateTime(2011, 10, 12); TimeSpan span = newYears.Subtract(christmas); console.Writeline(span);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)