| Formats |
| Category: | Date and Time |
| Alignment: | right |
| Default Time Period: | AM |
| Syntax | |
| Syntax Description | |
| Details | |
| Comparison | |
| Examples | |
| See Also |
Syntax |
| MDYAMPMw. |
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> |
is an integer from 1 through 12 that represents the month.
is an integer from 1 through 31 that represents the day of the month.
specifies a two-digit or four-digit integer that represents the year.
is the number of hours that range from 0 through 23.
is the number of minutes that range from 00 through 59.
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.
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: | |||
|
Informat: |
Copyright © 2011 by SAS Institute Inc., Cary, NC, USA. All rights reserved.