Convert date time to SAS date

Reply
Occasional Contributor
Posts: 5

Convert date time to SAS date

Hello,

Can you please help me convert a datetime which is currently in the form of 01JUN2015:00:00:00 to SAS date (ie. the 5 digit number)?

thank you

Trusted Advisor
Posts: 1,137

Re: Convert date time to SAS date

Considering that the date is in character form.

data have;

date='01JUN2015:00:00:00';

date2=datepart(input(date,datetime20.));

/*format date2 date9.;*/

run;

Thanks,

Jag

Thanks,
Jag
Ask a Question
Discussion stats
  • 1 reply
  • 172 views
  • 0 likes
  • 2 in conversation