Method: Hour for VBS
- Updated2024-09-12
- 1 minute(s) read
Methods > Method: Hour for VBS
Method: Hour for VBS
Specifies the hour of the day in a time expression.
vHour = Object.Hour(Time)
Object | VBS Object with this method. You do not need to specify this object. |
Time | Variant Specifies a time expression. |
vHour | Variant Receives an integer between 0 and 23 which represents the hour of the day. |
The following example returns the current hour:
Dim Myvar MyVar = Hour(Now) Call MsgBox(MyVar)
See Also
Related Topics
DateAdd | DateDiff | DatePart | DateSerial | DateValue | Date | Day | Hour | Minute | MonthName | Month | Now | Second | TimeSerial | TimeValue | Time | Timer | Weekday | WeekdayName | Year