date conversion

Reply
Occasional Contributor
Posts: 18

date conversion

Hi everyone!

Could you help me to convert date in 12 hr(eg. 12/09/2012 4:30:15 PM ) to 24 hrs (eg. 12/09/2012 16:30:15) and vice versa? I really appreciate your help.

Thanks

Ram Adhikari

Contributor
Posts: 66

Re: date conversion

Posted in reply to ram_adhikari_jacks_sdstate_edu

I think this one is a formatting issue!!

Super User
Super User
Posts: 7,042

Re: date conversion

proc format;

  picture xdt other='%0m/%0d/%0Y %0H:%0M:%0S' (datatype=datetime);

run;

data x;

indate='12/09/2012 4:30:15 PM';

dt = input(indate,anydtdtm22.);

outdate=put(dt,xdt.);

put (_all_) (=/);

run;

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