DHMS Function

Returns a SAS datetime value from date, hour, minute, and second values.

Category: Date and Time
Returned data type: DOUBLE

Syntax

Arguments

date

specifies any valid expression that represents a SAS date value.

Data type DOUBLE
See <sql-expression>
FedSQL Expressions

hour

specifies a numeric expression that represents an integer from 1 through 12.

Data type DOUBLE
See <sql-expression>
FedSQL Expressions

minute

specifies a numeric expression that represents an integer from 1 through 59.

Data type DOUBLE
See <sql-expression>
FedSQL Expressions

second

specifies a numeric expression that represents an integer from 1 through 59.

Data type DOUBLE
See <sql-expression>
FedSQL Expressions

Details

The DHMS function returns a numeric value that represents a SAS datetime value. This numeric value can be either positive or negative.

Example

The following statements illustrate the DHMS function:
Statements
Results
select dhms(mdy(08,10,2016),5,10,15);
1786425015
select put(dhms(date'2016-08-10',
5,10,15),datetime18.);
10AUG16:05:10:15

See Also

Functions:
Last updated: February 23, 2017