Hello All
I have two dates in following format
Date 1 - December 11, 2018 05:15:20PM
Date 2 - January 21, 2018 01:25:21AM
How can i calculate difference between these two date in HOURS ?
Thanks in Advance
data test;
char_Date1='December 11, 2018 05:15:20PM';
Num_date1=input(char_Date1,anydtdtm32.);
char_Date2='January 21, 2018 01:25:21AM';
Num_date2=input(char_Date2,anydtdtm32.);
Difference=abs(intck('DTHOUR',Num_date1,Num_date2));
format num_date: datetime20.;
run;
Oh I blame the damn!!!!!!!!!!!!!!!!! Dunkin Coffee(still not waking me up) that my eyes didn't even notice the VA in the question. My apologies. Best is to wait for somebody who knows VA to respond. Sorry about that.
Hi @JanSanford I'm afraid I do not work with SAS VA. Are you expecting a solution in SAS VA?
Datetimes are stored as seconds. You could just subtract one from the other then divide by 3,600 to convert to hours.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.
Find more tutorials on the SAS Users YouTube channel.