/// <Summary> /// overloaded. returns the absolute value of the date difference between two dates. /// </Summary> /// <Param name = "datetime1"> first date and time </param> /// <Param name = "datetime2"> second date and time </param> /// <returns> </returns> private string datediff (datetime datetime1, datetime datetime2) {string datediff = NULL; try {timespan ts1 = new timespan (datetime1.ticks); timespan ts2 = new timespan (datetime2.ticks); timespan Ts = ts1.subtract (ts2 ). duration (); datediff = ts. days. tostring () + "day" + ts. hours. tostring () + "Hour" + ts. minutes. tostring () + "Minute" + ts. seconds. tostring () + "second";} catch {} return datediff;} // <summary> // overloaded. calculates the time interval between a time and the current local date and time, and returns the absolute value of the date difference between the time interval. /// </Summary> /// <Param name = "datetime1"> A Date and time </param> /// <returns> </returns> private string datediff (datetime datetime1) {return this. datediff (datetime1, datetime. now );}