Name

Hour Function — Microsoft.VisualBasic.DateAndTime

Synopsis

Hour(timevalue)
timevalue required; Date

Date variable or literal date whose hour component is to be extracted

Return Value

An Integer from 0 to 23, specifying the hour of the day

Description

Extracts the hour element from a time expression. 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.

Get VB.NET Language Pocket Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.