Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Public Function basRndTime(dtTimeIn As Date, _
Optional rndIntvl As String = "n", _
Optional rndIncr As Long = 30, _
Optional rndUp As Boolean = True)
'Michael Red 2/26/04
'Interval (rndIntvl) corresponds to an arument for DateAdd
'Increment (rndIncr) corresponds to the # units for DateAdd
'Direction (rndUp) is a flag to indicate the function should _
round the value "up" (increase to the interval, whiich is the _
default) or to round the value "Down" - e.g. Subtract from the value)
Dim MyDiff As Long
Dim MyIncr As Long
MyDiff = (Format(dtTimeIn, rndIntvl) Mod rndIncr)
If (Sgn(rndUp) <> 0) Then
basRndTime = DateAdd(rndIntvl, rndIncr - MyDiff, dtTimeIn)
Else
basRndTime = DateAdd(rndIntvl, -MyDiff, dtTimeIn)
End If
End Function