Answers

Sep 28, 2007 - 09:59 AM
I found out it was more simple than I thought.
subtracting one date from another returns not a datetime as I thought I saw, but a TimeSpan object.
So you can do this:
TimeSpan difference = endTime.Subtract(startTime);
and then get the days with: difference.Days
subtracting one date from another returns not a datetime as I thought I saw, but a TimeSpan object.
So you can do this:
TimeSpan difference = endTime.Subtract(startTime);
and then get the days with: difference.Days

Jun 20, 2011 - 04:27 AM
How to get the difference between the 2 dates in c sharp.
Add New Comment