B Brian W Jan 24, 2004 #2 I don't think there is one, but, check out TimeSpan, I think that will give you what you want. DateTime dt1 = DateTime.Now; DateTime dt2 = <somoe other date>; TimeSpan ts = dt1 - dt2; //Use ts here HTH Brian W
I don't think there is one, but, check out TimeSpan, I think that will give you what you want. DateTime dt1 = DateTime.Now; DateTime dt2 = <somoe other date>; TimeSpan ts = dt1 - dt2; //Use ts here HTH Brian W
J Jon Skeet [C# MVP] Jan 24, 2004 #3 Jim Heavey said: What is the C# equivalent of the DateDiff Function in VB? Click to expand... Not knowing VB, I don't know exactly what DateDiff does. However, if you have two DateTimes, end and start, you can use: TimeSpan duration = end-start;
Jim Heavey said: What is the C# equivalent of the DateDiff Function in VB? Click to expand... Not knowing VB, I don't know exactly what DateDiff does. However, if you have two DateTimes, end and start, you can use: TimeSpan duration = end-start;
M Miha Markic Jan 24, 2004 #4 DateDiff returns date difference in requested unit (day, minute or stuff like that). TimeSpan is good equivalent.
DateDiff returns date difference in requested unit (day, minute or stuff like that). TimeSpan is good equivalent.