CSharp examples for System:DateTime Calculate
Will give you the difference between two dates
using System;/*from www. java 2s .co m*/ public class Main{ /// <summary> /// Will give you the difference between two dates /// </summary> /// <param name="dateOne"> /// The Start Date. /// </param> /// <param name="dateTwo"> /// The End Date /// </param> /// <returns> /// TimeSpan object /// </returns> public static TimeSpan Diff(this DateTime dateOne, DateTime dateTwo) { var t = dateOne.Subtract(dateTwo); return t; } }