Previous Page | Next Page

Informats

MDYAMPMw.d Informat



Reads datetime values in the form mm-dd-yy<yy> hh:mm:ss.ss AM|PM, where a special character such as a hyphen (-), period (.), slash (/), or colon (:) separates the month, day, and year; the year can be either 2 or 4 digits.
Category: Date and Time
Alignment: right
Default Time Period: AM
Requirement: A space must separate the date and the time.

Syntax
Syntax Description
Details
Comparisons
Examples
See Also

Syntax

MDYAMPMw.d


Syntax Description

w

specifies the width of the output field.

Default: 19
Range: 8-40
d

specifies the number of digits to the right of the decimal point in the seconds value. The digits to the right of the decimal point specify a fraction of a second. This argument is optional.

Default: 0
Range: 0-39

Details

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

mm-dd-yy<yy> hh:mm<:ss<.ss>> <AM | PM>

where:
mm

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

dd

is an integer from 01 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 00 through 23.

mm

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

ss.ss

is the number of seconds that range from 00 through 59 with the fraction of a second following the decimal point.

Requirement: If a fraction of a second is specified, the decimal point can be represented only by a period and is required.
AM | PM

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

- or :

represents one of several special characters, such as the slash (/), hyphen (-), colon (:), or a blank character that can be used to separate date and time components. Special characters can be used as separators between any date or time component and between the date and the time.


Comparisons

The MDYAMPMw.d informat reads datetime values with optional separators in the form mm-dd-yy<yy> hh:mm:ss.ss AM | PM, and requires a space between the date and the time.

The DATETIMEw.d informat reads datetime values with optional separators in the form dd-mmm-yy<yy> hh:mm:ss.ss AM|PM, and the date and time can be separated by a special character.

The YMDDTTMw.d informat reads datetime values with required separators in the form <yy>yy-mm-dd/hh:mm:ss.ss.


Examples

input @1 dt mdyampm25.2.;

Data Line Results
09.15.2008 03:53:00 pm
1537113180
09-15-08 3.53 pm
1537113180


See Also

Informat:

DATETIMEw. Informat

YMDDTTMw.d Informat

Previous Page | Next Page | Top of Page