Help using Base SAS procedures

DateTime Format

Reply
New Contributor
Posts: 3

DateTime Format

Hi

Need your kindly help on DateTime format please.

05DEC10:11:57:00, Which SAS datatime format should I use.

Thank you.

Super User
Posts: 3,252

DateTime Format

data _null;

   datetime = '05DEC10:11:57:00'dt;

   format datetime datetime16.;

   put datetime = ;

run;

Respected Advisor
Posts: 4,920

DateTime Format

Follow SASKiwi's advice and further use DATETIME16. both for input and output as in:

data _null_;

   dateTimeStr = '05DEC10:11:57:00';
   format dateTime datetime16.;
   dateTime = input(dateTimeStr, datetime16.);
   put dateTimeStr = dateTime = ;

run;

PG

PG
Ask a Question
Discussion stats
  • 2 replies
  • 209 views
  • 0 likes
  • 3 in conversation