## Answers

Dec 22, 2009 - 07:13 PM

For C# you could just subtract the days or use the subtract method

eg

DateTime dt1 = ... some date value

DateTime dt2 = ... another date value

TimeSpan ts = dt1 - dt2;

or

TimeSpan ts = dt1.Subtract(dt2);

then use Days to get the number of days

eg

int daysDiff = ts.Days;

eg

DateTime dt1 = ... some date value

DateTime dt2 = ... another date value

TimeSpan ts = dt1 - dt2;

or

TimeSpan ts = dt1.Subtract(dt2);

then use Days to get the number of days

eg

int daysDiff = ts.Days;

Dec 22, 2009 - 07:15 PM

For Javascript, I haven't tried it but you could maybe try the examples given here http://www.dotnetspider.com/forum/213...

Add New Comment