TIMEw. Informat

Reads hours, minutes, and seconds in the form hh:mm:ss.ss, where special characters such as the colon (:) or the period (.) are used to separate the hours, minutes, and seconds.
Category: Date and Time

Syntax

TIMEw.

Syntax Description

w
specifies the width of the input field.
Default:8
Range:5–32

Details

The TIMEw. informat reads SAS time values in the form: hh:mm:ss<.ss> <AM | PM>:
hh
is an integer that represents the number of hours.
:
represents a special character that separates hours, minutes, and seconds.
mm
is an integer between 00 and 59 that represents minutes.
ss<.ss>
is an integer that represents the number of seconds, and if needed, tenths of a second. Seconds and tenths of a second must always be separated by a period.
AM | PM
AM indicates time between 12:00 midnight and 11:59 in the morning. PM indicates time between 12:00 noon and 11:59 at night.
Separate hh, mm, and ss with a special character. When the period is used as the special character, the time is interpreted in the order hours, minutes, and seconds. For example, 23.22 is 23 hours and 22 minutes, not 23 minutes and 22 seconds, or 23 seconds and 22 tenths of a second.
If you do not enter a value for seconds, SAS assumes a value of 0.
The stored value is the total number of seconds in the time value.

Example

input begin time10.; 
Data Line
Result
Formatted with TIMEw.
----+----1
12.56
46560
12:56:00
120:120
439200
122:00:00 
1:13 pm
47580
13:13:00 

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