DateTime x = DateTimeNow(); DateTime now = DateTime.Now; TimeSpan diff = now - x; System.Console.Write("File over stayed : time Differnece : " + diff); DateTime time = "00:30:00.000"; if (diff > time ) //This is where I get an Error { System.Console.Write("File time too long : time Differnece : " + diff); } else { System.Console.Write("File still new :"+diff); }
DateTime
TimeSpan
DateTime first = GetFirstDate(); DateTime second = GetSecondDate(); if (first.Date.Equals(second.Date)) { // the dates are equal } in linq: e => DateTime.Compare(e.FirstDate.Value, SecondDate) >= 0
TimeSpan time = new TimeSpan(0, 30, 0); if(diff > time) ...
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)