I see that this question has been answered for Java , JavaScript , and PHP , but not C#.
(我看到Java , JavaScript和PHP都回答了这个问题,但C#却没有。)
(那么,如何计算C#中两个日期之间的天数?)
假设StartDate和EndDate的类型为DateTime :
StartDate
EndDate
DateTime
(EndDate - StartDate).TotalDays
1.4m articles
1.4m replys
5 comments
57.0k users