Chapter Contents

Previous

Next
DHMS

DHMS



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

Category: Date and Time


Syntax
Arguments
Examples
See Also

Syntax

DHMS(date,hour,minute,second)

Arguments

date
specifies a SAS expression that represents a SAS date value.

hour
specifies a SAS expression that represents an integer from 0 through 23.

minute
specifies a SAS expression that represents an integer from 0 through 59.

second
specifies a SAS expression that represents an integer from 0 through 59.


Examples

The following SAS statements produce these results:

SAS Statements Results
dtid=dhms('01jan89'd,15,30,15);
put dtid / dtid datetime.;
 
915291015
01JAN89:15:30:15

The following SAS statements show how to combine a SAS date value with a SAS time value into a SAS datetime value. If you execute these statements on August 13, 1997 at the time of 15:55:50, it produces these results:

SAS Statements Result
day=date();
time=time();
sasdt=dhms(day,0,0,time);
put sasdt datetime.;
 

13AUG97:15:55:50



See Also

Function:

HMS


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.