Method: TimeSerial for VBS
- Updated2024-09-12
- 1 minute(s) read
Methods > Method: TimeSerial for VBS
Method: TimeSerial for VBS
Specifies the time in hours, minutes, and seconds.
vTimeSerial = Object.TimeSerial(Hour, Minute, Second)
| Object | VBS Object with this method. You do not need to specify this object. |
| Hour | Variant Specifies a number in the range between 0 and 23. |
| Minute | Variant Specifies any numeric expression. If the value is greater than 59, the method TimeSerial transfers the amount to the next larger unit. If the value is smaller than 0, the method transfers the amount to the next smaller unit. |
| Second | Variant Specifies any numeric expression. If the value is greater than 59, the method TimeSerial transfers the amount to the next larger unit. If the value is smaller than 0, the method transfers the amount to the next smaller unit. |
| vTimeSerial | Variant Receives the time. |
The following example generates a time value with hours, minutes and seconds:
Dim MyTime MyTime = TimeSerial(6, -15, 0) Call MsgBox(MyTime) ' Returns 5:45:00 AM
See Also
Related Topics
DateAdd | DateDiff | DatePart | DateSerial | DateValue | Date | Day | Hour | Minute | MonthName | Month | Now | Second | TimeSerial | TimeValue | Time | Timer | Weekday | WeekdayName | Year