Returns the hour from a SAS time or datetime value
Category: Date and Time
HOUR (< time datetime >)
time
specifies a SAS expression that represents a SAS time value.
datetime
specifies a SAS expression that represents a SAS datetime value.
The HOUR function returns a numeric value that represents the hour from a SAS time or datetime value. Numeric values can range from 0 through 23. HOUR always returns a positive number.
The following SAS statements produce these results:
SAS Statements | Results |
---|---|
now='1:30't; h=hour(now); put h; | 1 |
Functions:
'MINUTE Function' on page 647
'SECOND Function' on page 819