Check if Time is Greater than current time

Viewed 45

I want to check if the reservation time is over from the current time. For example, if the reservation time is 4:00-6:00 pm, if customers arrive at 4:15 pm, the system must say that reservation needs to cancel.

`if its 15 minutes late` 
Dim dt1 = "4:15:00"
Dim dt2 = "6:15:00"
Dim dt3 = "8:15:00"
Dim com As New MySqlCommand
    
com = New MySqlCommand("SELECT * FROM reservation WHERE Time = '4:00:00', '6:00:00', '8:00:00' ", conn)

If DateTime.Now >= dt1 Then
    MsgBox("Reservation needs to Cancel!")
ElseIf DateTime.Now >= dt2 Then
    MsgBox("Reservation needs to Cancel!")
ElseIf DateTime.Now >= dt3 Then
    MsgBox("Reservation needs to Cancel!")
Else
    
End If
0 Answers
Related