Previous Page | Next Page

Formats

TODw.d Format



Writes SAS time values and the time portion of SAS datetime values in the form hh:mm:ss.ss.
Category: Date and Time
Alignment: right

Syntax
Syntax Description
Details
Comparisons
Examples
See Also

Syntax

TODw.d

Syntax Description

w

specifies the width of the output field.

Default: 8
Range: 2-20
Tip: SAS writes a zero for a zero hour if the specified width is sufficient. For example, 02:30 or 00:30.
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 TODw.d format writes SAS time and datetime values in the form hh:mm:ss.ss, where

hh

is an integer that represents the hour.

mm

is an integer that represents the minutes.

ss.ss

is the number of seconds to two decimal places.


Comparisons

The TODw.d format writes a leading zero for a single-hour digit. The TIMEw.d format and the HHMMw.d format write a leading blank for a single-hour digit.


Examples

In the following example, the SAS datetime value 1566742823 corresponds to August 24, 2009 at 2:20:23 p.m.

SAS Statement Results
 
----+----1
begin = '1:30't;

put begin tod5.;
01:30
begin = 1566742823;
put begin tod9.;



 14:20:23


See Also

Formats:

HHMMw.d Format

TIMEw.d Format

TIMEAMPMw.d Format

Function:

TIMEPART Function

Informat:

TIMEw. Informat

Previous Page | Next Page | Top of Page