dm 'log;clear;odsresults;clear';
data d;
start_date='18Nov2014'd ;
format start_date date9.;
current_date='18Nov2020'd ;
format current_date date9.;
years=intck('Year' ,start_date,current_date);
months=intck('Month',start_date,current_date);
days= intck('Day',start_date,current_date);
hours=intck('hour','22:10:00't ,1) ;
proc print;run;Here I want to get hour minute second from start_date and current_date why it gives 22 hours
'hour' is a time interval, times are counts of seconds. 1 translates to 00:00:01, so you have 22 hour boundaries between that and 22:10:00.
If you want the difference between dates (there are no timestamp/datetime values in your code) expressed as hours, multiply the day difference by 24.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.