我需要检查日期和月份。我正在使用Date.Now
.
例如:
如果 day =9 和 month=10 然后采取行动
我怎样才能做到这一点?
使用DateTime 变量的Day
和属性:Month
Dim currentDate As DateTime = DateTime.Now
If currentDate.Month = 10 AndAlso currentDate.Day = 9 Then
'Do something
End If
Date.Now.Month 和 Date.Now.Day。这些是 Date 类型的属性。
Dim today = Date.Now.Date
If today.Day = 9 AndAlso today.Month = 10 Then ...
Date.today.day
Date.today.month
Dim today = Date.Today
Dim day = today.day
Dim month = today.Month
Dim year = today.Year
If day = 10 And Also month = 10 Then
Label1.Text = today . Day
Label2.Text = today . Month
Label3.Text = Date . Today
Label4.Text = Time Of Day
Label5.Text = year