To start off, use 24 hours time instead of am pm. So for the time slot of 1:00pm to 1:05pm, express it as 13 hr 0 minute to 13 hr 5 minute in the code.
Based on your description, you are only interested in hour and minute parts of the time. So the question is really which time slot the current hour and current minute in, right? This lead us to how to find the current hour and current minute. Look through the reference link that Richard has given you, can you find the right methods?
1. Find current date using
DateTime.Now Property[
^]
2. Find current hour from the current date using
DateTime.Hour Property (System)[
^]
3. Find current minute from current date using
DateTime.Minute Property (System)[
^]
4. The rest is just maths couple with if else statements, e.g.
Imports System
Public Module Module1
Public Sub Main()
Dim now As Date = Date.Now
Dim hour As Integer = now.Hour
Dim minute As Integer = now.Minute
Console.WriteLine(hour)
Console.WriteLine(minute)
If hour = 13 And minute <= 5 Then
Console.WriteLine("Run method A")
Else
Console.WriteLine("Run method B")
End If
End Sub
End Module
Refer to the link by Richard if you seek further manipulation of date time. One way to learn coding is to refer to the document and experiment with the various methods.