Previous Page | Next Page

Formats

MDYAMPMw.d Format



Writes datetime values in the form mm/dd/yy<yy> hh:mm AM|PM. The year can be either two or four digits.
Category: Date and Time
Alignment: right
Default Time Period: AM

Syntax
Syntax Description
Details
Comparison
Examples
See Also

Syntax

MDYAMPMw.


Syntax Description

w

specifies the width of the output field.

Default: 19
Range: 8-40

Details

The MDYAMPMw.d format writes SAS datetime values in the following form:

mm/dd/yy<yy> hh:mm<AM | PM>
The following list explains the datetime variables:
mm

is an integer from 1 through 12 that represents the month.

dd

is an integer from 1 through 31 that represents the day of the month.

yy or yyyy

specifies a two-digit or four-digit integer that represents the year.

hh

is the number of hours that range from 0 through 23.

mm

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

AM | PM

specifies either the time period 00:01-12:00 noon (AM) or the time period 12:01-12:00 midnight (PM). The default is AM.

date and time separator characters

is one of several special characters, such as the slash (/), colon (:), or a blank character that SAS uses to separate date and time components.


Comparison

The MDYAMPMw. format writes datetime values with separators in the form mm/dd/yy<yy> hh:mm AM | PM, and requires a space between the date and the time.

The DATETIMEw.d format writes datetime values with separators in the form ddmmmyy<yy>: hh:mm:ss.ss.


Examples

This example uses the input value of 1537113180, which is the SAS datetime value that corresponds to 3:53:00 PM on September 15, 2008.

SAS Statement Results
put dt mdyampm25.
9/15/2008 3:53 PM


See Also

Format:

DATETIMEw.d Format

Informat:

MDYAMPMw.d Informat

Previous Page | Next Page | Top of Page