how to calculate number of weeks given 2 dates?

后端 未结 7 1922
耶瑟儿~
耶瑟儿~ 2020-12-11 15:45

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?

相关标签:
7条回答
  • 2020-12-11 16:17
    (dtTo - dtFrom).TotalDays / 7
    

    will give number of weeks

    0 讨论(0)
提交回复
热议问题