Writes time values as hours and minutes in the form
hh:mm.
Category: |
Date and Time
|
Alignment: |
right
|
-
w
-
specifies the width of the output field.
-
d
-
specifies the number of digits to the right
of the decimal point in the minutes value. The digits to the right of the
decimal point specify a fraction of a minute. This argument is optional.
Default: |
0 |
Range: |
0-19 |
Requirement: |
must be less than
w |
The HHMMw.d format writes SAS time values in the form
hh:mm, where
-
hh
Note: If hh is a single digit,
HHMMw.d places a leading blank before the digit. For example,
the HHMMw.d. format writes 9:00 instead of 09:00. ![[cautionend]](../../../../common/63294/HTML/default/images/cautend.gif)
-
is an integer.
-
mm
-
is the number of minutes that range from
00 through 59.
SAS rounds hours and minutes that are based on the value
of seconds in a SAS time value.
The HHMM format uses asterisks to format values that are outside the
time range 0-24 hours, such as datetime values.
The HHMMw.d format is similar to the
TIMEw.d format except that the HHMMw.d format does not print
seconds.
The HHMMw.d format writes a leading blank
for a single-hour digit. The TODw.d format writes
a leading zero for a single-hour digit.
The example table uses the input value of 46796, which
is the SAS time value that corresponds to 12:59:56 p. m.
SAS Statement |
Results |
|
----+----1
|
put time hhmm.;
|
13:00
|
put time hhmm8.2;
|
12:59.93
|
In the first example, SAS rounds up the time value four seconds
based on the value of seconds in the SAS time value. In the second example,
by adding a decimal specification of 2 to the format shows that fifty-six
seconds is 93% of a minute.
|
Formats:
|
|
Functions:
|
|
Informat:
|
Copyright © 2011 by SAS Institute Inc., Cary, NC, USA. All rights reserved.