TimeSerial Function
ReturnsDateChild typeVariant, Including the time of the timer, minute, and second.
TimeSerial (Hour, minute, second)
Parameters
Hour
The value is A numeric or numeric expression from 0 (a.m.) to 23 (p.m.
Minute
Any numeric expression.
Second
Any numeric expression.
Description
To specify a time point, such as 11:59:59,TimeSerialThe value of the parameter should be within the acceptable range; that is, the hour should be between 0-23, and the minute and second should be between 0-59. However, you can use a numeric expression to specify the relative time for each parameter. This expression represents the time, minute, or second before or after a time.
The following example uses the expression of absolute time.TimeSerialThe function returns the 15 minutes (-15) before the first six (12-6) hours, or 5:45:00 A.M.
Dim MyTime1MyTime1 =TimeSerial (12-6,-15,0)'Return5:45:00 AM.
When the value of any parameter exceeds the acceptable range, it is correctly carried to the next large time unit. For example, if 75 minutes are specified, the time is interpreted as one hour and 15 minutes. However, if any parameter value exceeds the range of-32768 to 32767, an error occurs. If the time specified by the three parameters or the time calculated by the expression exceeds the acceptable date range, an error occurs.