I have two DateTime variables and i need to compute number of weeks between them.
What is the quickest (and correct) way to do this?
Use TimeSpan
:
double weeks = (date1 - date2).TotalDays / 7;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With