Dim Sdate,Tdate As Date Sdate="2013-12-12" Tdate="2013-12-25" Dim T As TimeSpan=TDate-Sdate Dim d As Integer For i As Integer=0 To t.TotalDays '将时段t转换为天数
'如果当天对应的周为0(星期日)或6(星期六) If (sdate.AddDays(i)).DayOfWeek=0 OrElse (sdate.AddDays(i)).DayOfWeek=6 Then d=d+1 End If Next Messagebox.Show(d)