Here is an example of what I was talking about using the if elseif then statement. This assumes you have two labels on a form named Label2 and Label3.
Private Sub Load_Time()
'calculates the rounded time
Dim newtime As DateTime
Dim min As Integer = Now.Minute
Label2.Text = Now.ToShortTimeString
If min >= 0 And min <= 15 Then 'First Quarter
If min > 7 Then
'move up
newtime = New DateTime(Now.Year, Now.Month, Now.Day, Now.Hour, 15, Now.Second)
Label3.Text = newtime.ToShortTimeString
Else
'move down
newtime = New DateTime(Now.Year, Now.Month, Now.Day, Now.Hour, 0, Now.Second)
Label3.Text = newtime.ToShortTimeString
End If
ElseIf min > 15 And min <= 30 Then 'Second Quarter
If min > 22 Then
'move up
newtime = New DateTime(Now.Year, Now.Month, Now.Day, Now.Hour, 30, Now.Second)
Label3.Text = newtime.ToShortTimeString
Else
'move down
newtime = New DateTime(Now.Year, Now.Month, Now.Day, Now.Hour, 15, Now.Second)
Label3.Text = newtime.ToShortTimeString
End If
ElseIf min > 30 And min <= 45 Then 'Third Quarter
If min > 37 Then
'move up
newtime = New DateTime(Now.Year, Now.Month, Now.Day, Now.Hour, 45, Now.Second)
Label3.Text = newtime.ToShortTimeString
Else
'move down
newtime = New DateTime(Now.Year, Now.Month, Now.Day, Now.Hour, 30, Now.Second)
Label3.Text = newtime.ToShortTimeString
End If
ElseIf min > 45 And min <= 59 Then 'Fourth Quarter
If min > 52 Then
'move up
newtime = New DateTime(Now.Year, Now.Month, Now.Day, Now.Hour + 1, 0, 0)
Label3.Text = newtime.ToShortTimeString
Else
'move down
newtime = New DateTime(Now.Year, Now.Month, Now.Day, Now.Hour, 45, Now.Second)
Label3.Text = newtime.ToShortTimeString
End If
End If
newtime = Nothing
min = Nothing
End Sub
Recreating the wheel is the best way to appreciate what the previous coders have gone through to get you where you are now.