Something like this:
Note that I store Now in a variable, that way it will be the same for both evaluations.Code:Dim dtn As DateTime = Now Dim ts3AM As TimeSpan = New TimeSpan(3, 0, 0) Dim ts430AM As TimeSpan = New TimeSpan(4, 30, 0) If (dtn.TimeOfDay > ts3AM And dtn.TimeOfDay < ts430AM) Then MessageBox.Show("Between 3 and 430") End If




Reply With Quote