Let’s say we haveStartDate
and EndDate
and those are of type DateTime
.
If you want to have an int value as a result then:
int theResult = (EndDate - StartDate).Days;
And if you want to have a double value as a result then:
double theResult = (EndDate - StartDate).TotalDays;