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
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
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)