C# DateDiff |
| mv ark replied to divya rocks at 08-May-08 04:00 |
C# doesn't have a native DateDiff method like VB does. In your case, you could first check if the dates are the same using the DateTime.Compare() method & then customise the custom C# DateDiff method here - http://blog.blueshop.com.tw/josephlee/archive/2004/12/31/1199.aspx
DateTime.Compare(t1, t2) returns 0 if both dates t1, t2 are same. For more info on DateTime.Compare(), check this link: http://msdn.microsoft.com/en-us/library/system.datetime.compare.aspx |
| Biography |
| M.V. 'Anil' Radhakrishna is a seasoned developer and a Microsoft MVP (ASP/ASP.NET). He blogs his little discoveries and Web development tips, tricks and trivia quite regularly. You can find some of his unusual code samples & snippets at his Code Gallery. |
|