根据VB.Net中的另外两个日期替换“到期”日期?

时间:2010-09-21 22:29:57

标签: vb.net date

我想根据与另一个日期的交替获得“到期”或预测的检查日期?我该怎么做呢?

三江源!

Enum EnumSiteInspectionFrequency As Integer ' alternating with WRA
            None = 0  ' None
            Yearly = 12  '12 months
            SecondYearly = 24  '24 months
End Enum

Sub Calculate()
Dim SiteName as String = "Worksite Name Here"
Dim SiteInspectionFrequency = EnumSiteInspectionFrequency.SecondYearly

' Dates
Dim LastInspection As Date = DateTime.Parse("01/01/2010")
Dim LastSafetyInspection As Date = DateTime.Parse("22/03/2010")

Dim DueInspection As Date

' The due inspection either can be 24 months (second yearly) but it has to alternate with the last safety inspection.

End Sub

1 个答案:

答案 0 :(得分:0)

使用vb.net Timespan回答问题