TimeSerial

Public Function TimeSerial(ByVal Hour As Long, Optional ByVal Minute As Long = 0, Optional ByVal Second As Long = 0) As Date

Creates a time with the specified parameters. These parameters can have any value (both positive and negative)

Dim lHour As Long = Hour(Now)
Dim lMinute As Long = Minute(Now)
Dim lSecond As Long = Second(Now)

SendDebug $"The time now is {TimeSerial(lHour, lMinute, lSecond)}"
SendDebug $"In 5 hours, it will be {TimeSerial(lHour + 5, lMinute, lSecond)}"
SendDebug $"A quarter ago it was {TimeSerial(lHour, lMinute - 15, lSecond)}"
SendDebug $"In 5891 seconds it will be {TimeSerial(lHour, lMinute, lSecond + 5891)}"

See also: