Click here to Skip to main content
14,391,319 members
Rate this:
Please Sign up or sign in to vote.
See more:
pls help me on this...my code is in below.........

Private Sub Form_Load()
time1.Text = "1100"
time2.Text = "1700"

End Sub

Private Sub Timer2_Timer()
lblTime.Caption = "Current Time : " & Format(DateTime.Now, "HH:MM:ss")

AM = time1.Text & "00"
PM = time2.Text & "00"
lblactualtime.Caption = Format(DateTime.Now, "HH:MM:ss")

If AM = Format(DateTime.Now, "HHMMss") Then
SendEmail
   

Else
    If PM = Format(DateTime.Now, "HHMMss") Then
    SendEmail
        End If
End If

End Sub
Posted

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

Try this
Dim sTime As DateTime = DateTime.Parse("4:00:00 PM") 'start
Dim eTime As DateTime = DateTime.Parse("6:00:00 AM") 'end
If DateTime.Now.CompareTo(sTime) >= 0 And DateTime.Now.CompareTo(eTime) <= 0 Then
'Do Something

End If
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100