Previous Page | Next Page

Informats

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
Syntax Description
Details
Examples
See Also

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 following form:

hh:mm:ss<.ss> <AM | PM>

where

hh

is an integer that represents the number of hours.

:

represents a special character that separates hours, minutes, and seconds.

mm

is the number of minutes that range from 00 through 59.

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.


Examples

input begin time10.; 

Data Line Results 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

Formats:

HHMMw.d Format

HOURw.d Format

MMSSw.d Format

TIMEw.d Format

Functions:

HOUR Function

MINUTE Function

SECOND Function

TIME Function

Previous Page | Next Page | Top of Page