Compare DateTime in ASP.NET difference between Datetime Posted Jan 20, 2009 by Softminer ASP.NET C# DateTime Dtnow;Dtnow = DateTime.Now;DateTime DtAgo;DtAgo= DateTime.Now.AddDays();TimeSpan tsDiff = Dtnow.Subtract(DtAgo);string Diff = tsDiff.ToString() or tsDiff.Minutes.ToString(); Permalink 1 comments
try these also
DateTime newDate = new DateTime(2000, 5, 1);
String diff2 = (secondDate - firstDate).TotalDays.ToString();
source http://csharp.net-informations.com/statements/csharp-date-difference.htm
maaki
Post a Comment