TIMEw.d Format

Writes time values as hours, minutes, and seconds in the form hh:mm:ss.ss.

Category: Date and Time
Alignment: Right
Interaction: When the DECIMALCONV= system option is set to STDIEEE, the output that is written using this format might differ slightly from previous releases. For more information, see DECIMALCONV= System Option in SAS System Options: Reference.

Syntax

TIMEw.d

Syntax Description

w

specifies the width of the output field.

Default 8
Range 2–20
Tip Make w large enough to produce the desired results. To obtain a complete time value with three decimal places, you must allow at least 12 spaces: eight spaces to the left of the decimal point, one space for the decimal point, and three spaces for the decimal fraction of seconds.

d

specifies the number of digits to the right of the decimal point in the seconds value. This argument is optional.

Default 0
Range 0–19
Requirement must be less than w

Details

The TIMEw.d format writes SAS time values in the form hh:mm:ss.ss:
hh
is an integer.
Note: If hh is a single digit, TIMEw.d places a leading blank before the digit. For example, the TIMEw.d. format writes 9:00 instead of 09:00.
mm
is an integer between 00 and 59 that represents minutes.
ss.ss
is the number of seconds between 00 and 59, with the fraction of a second following the decimal point.

Comparisons

The TIMEw.d format is similar to the HHMMw.d format except that TIMEw.d includes seconds.
The TIMEw.d format writes a leading blank for a single-hour digit. The TODw.d format writes a leading zero for a single-hour digit.

Examples

Example 1

This example uses the input value of 59083, which is the SAS time value that corresponds to 4:24:43 p.m.
SAS Statement
Result
----+----1
put begin time.;
16:24:43

Example 2

This example uses the input value of 32083, which is the SAS time value that corresponds to 8:54:43 a.m.
SAS Statement
Result
----+----1
put begin time.;
 8:54:43

See Also

Functions:
HOUR Function in SAS Functions and CALL Routines: Reference
MINUTE Function in SAS Functions and CALL Routines: Reference
SECOND Function in SAS Functions and CALL Routines: Reference
TIME Function in SAS Functions and CALL Routines: Reference
Informats: