TIMESERIAL

TIMESERIAL(hour, minute, second)

Returns the time for a specific hour, minute and second (Date).

hourThe hour between 0 and 23 (Integer).
minuteThe minutes between 0 and 59 (Integer).
secondThe seconds between 0 and 59 (Integer).

REMARKS
* This function can accept values outside the normal range.
* If you pass in 90 seconds it will return a time in the next minute and 30 seconds.
* You can specify relative times for each argument representing some number of hours, minutes, or seconds before or after a certain time.
* The following example uses expressions instead of absolute time numbers.
* This function returns a time for 15 minutes before (-15) six hours before noon (12 - 6), or 5:45:00 A.M.
* If any argument is outside -32,768 to 32,767 then an error occurs. Type Mismatch.
* You can use the NOW function to return the current system date and time.
* You can use the TIME function to return the current system time.
* You can use the TIMEVALUE function to return the time given a string representation.
* The equivalent .NET function is [[Microsoft.VisualBasic.DateAndTime.TimeSerial]]
* For the Microsoft documentation refer to learn.microsoft.com

Debug.Print TimeSerial(12 - 6, -15, 0)  '= 05:45:00  
Debug.Print TimeSerial(12,30,0) '= 12:30:00
Debug.Print TimeSerial(10,90,0) '= 11:30 '90 minutes added

© 2025 Better Solutions Limited. All Rights Reserved. © 2025 Better Solutions Limited Top