DATA Step, Macro, Functions and more

How to convert DATETIME to ISO8601 format ?

Reply
Occasional Contributor
Posts: 11

How to convert DATETIME to ISO8601 format ?

 

How do I convert   05AUG16:17:10:05   to  2016-08-05T17:10:05  ?

 

 

Thanks for your help.

Occasional Contributor
Posts: 6

Re: How to convert DATETIME to ISO8601 format ?

data _NULL_;
format
dt datetime20.
dt2 E8601DT20.
;
dt=datetime();
dt2=dt;
put dt= dt2=;
txt=put(dt,datetime20.);
txt2=put(dt2,E8601DT20.);
put txt= txt2=;
run;

 

http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a003169814.htm

 

Ask a Question
Discussion stats
  • 1 reply
  • 270 views
  • 0 likes
  • 2 in conversation