Check out example codes for "c# calculate difference between two dates in days". It will help you in understanding the concepts better.

Code Example 1

(EndDate - StartDate).TotalDays //double
(EndDate.Date - StartDate.Date).Days //int

Learn ReactJs, React Native from akashmittal.com