April 2002
Intermediate to advanced
688 pages
19h 51m
English
Hour Function
Microsoft.VisualBasic.DateAndTime
Hour(timevalue)timevalue (required; date)Date variable or literal date
An Integer from 0 to 23, specifying the hour of the day
Extracts the hour element from a time expression
The line:
MsgBox(Hour(#1:33:00 PM#))
displays the number 13.
Regardless of the time format passed to Hour, the return value will be a whole number between 0 and 23, representing the hour of a 24-hour clock.
If time contains
Nothing, 0 is returned, so be careful here to
check for Nothing.
You can also use the DatePart function.
Read now
Unlock full access