Thursday, August 14, 2008

DateSerial Function in VB.NET / Check if the Date is in DayLightSaving Range using VB.NET

How to Check if the Date is in DayLightSaving Range using VB.NET

VB.NET’s DAteTime function can be used to give the same output VBA’s DateSerial function

Sub GetDate()

Dim MyDate As DateTime

MyDate = New DateTime(2008, 8, 15)

MsgBox(DateSerial(2008, 8, 15))

If MyDate.IsDaylightSavingTime() = True Then

MsgBox("Specified day is within daylightsaving time")

End If

End Sub


No comments:

Post a Comment