A Quick Reference Guide to SAS Date, Time, and Datetime Formats - The Essential Guide to SAS Dates and Times, Second Edition (2014)

The Essential Guide to SAS Dates and Times, Second Edition (2014)

Appendix A. A Quick Reference Guide to SAS Date, Time, and Datetime Formats

This table shows the result when the same date, time, or datetime value is displayed with the corresponding format, using the default length for the given format.

The reference date for this table is Thursday, September 18, 2014.

If You Want Your Date
to Look Like This

Use This Format

18SEP14

DATE.

18

DAY.

18/09/14

DDMMYY.

18 09 14

DDMMYYB.

18:09:14

DDMMYYC.

18-09-14

DDMMYYD.

18092014

DDMMYYN.

18.09.14

DDMMYYP.

18/09/14

DDMMYYS.

Thursday

DOWNAME.

261

JULDAY.

14261

JULIAN.

09/18/14

MMDDYY.

09 18 14

MMDDYYB.

09:18:14

MMDDYYC.

09-18-14

MMDDYYD.

09182014

MMDDYYN.

09.18.14

MMDDYYP.

09/18/14

MMDDYYS.

09M2014

MMYY.

09:2014

MMYYC.

09-2014

MMYYD.

092014

MMYYN.

09.2014

MMYYP.

09/2014

MMYYS.

September

MONNAME.

9

MONTH.

SEP14

MONYY.

3

QTR.

III

QTRR.

Thursday, September 18, 2014

WEEKDATE.

Thursday, 18 September 2014

WEEKDATX.

5

WEEKDAY.

2014-W37-05

WEEKU.

2014-W38-04

WEEKV.

2014-W37-04

WEEKW.

September 18, 2014

WORDDATE.

18 September 2014

WORDDATX.

2014

YEAR.

2014M09

YYMM.

2014:09

YYMMC.

2014-09

YYMMD.

14-09-18

YYMMDD.

14 09 18

YYMMDDB.

14:09:18

YYMMDDC.

14-09-18

YYMMDDD.

20140918

YYMMDDN.

14.09.18

YYMMDDP.

14/09/18

YYMMDDS.

201409

YYMMN.

2014.09

YYMMP.

2014/09

YYMMS.

2014SEP

YYMON.

2014Q3

YYQ.

2014:3

YYQC.

2014-3

YYQD.

20143

YYQN.

2014.3

YYQP.

2014QIII

YYQR.

2014:III

YYQRC.

2014-III

YYQRD.

2014III

YYQRN.

2014.III

YYQRP.

2014/III

YYQRS.

2014/3

YYQS.

2014W37

YYWEEKU.

2014W38

YYWEEKV.

2014W37

YYWEEKW.

The reference time for this table is 2:45 p.m.

If You Want Your Time
to Look Like This

Use This Format

14:35

HHMM.

15

HOUR.

875

MMSS.

14:35:00

TIME.

2:35:00 PM

TIMEAMPM.

14:35:00

TOD.

The reference datetime for this table is 7:20 p.m. on Friday, December 12, 2014.

If You Want Your Datetime
to Look Like This

Use This Format

12DEC14:07:20:00 PM

DATEAMPM.

12DEC14:19:20:00

DATETIME.

12DEC14

DTDATE.

DEC14

DTMONYY.

Friday, 12 December 2014

DTWKDATX.

2014

DTYEAR.

14:4

DTYYQC.

12/12/2014 7:20 PM

MDYAMPM.