help with datetime

Joined
May 21, 2011
Messages
5
Programming Experience
Beginner
hi i am creating an alarm clock application which requires user input to switch off the alarm.

I have 3 comboBoxes on the form named day month year. when the user enters the correct date ( Current date) and click the button the alarm is deactivated.

can anyone help me with the code to check that the date entered in the comboBoxes is the current date.

any help with this would be great thanks in advance
 
Try using the Date.Parse() method then comparing it to todays date.

'Ex: If checkDate("5/21/2011") = True Then ......

Private Function checkDate(ByVal strDate As String) As Boolean
    Dim dCheckDate As Date = Date.Parse(strDate)
    If dCheckDate = Now.Date Then
        Return True
    Else
        Return False
    End If
End Function
 
You too!

-Josh
 
Back
Top