Hi,
I have this number 44824.689149 in sas table. If I put this it into an excel and format it in date time I get the following result is 20/09/2022 16:32:22.
How can I do this in sas?
I try with
data test;
a=put(44824.689149,datetime16.);
run;
but I get: 01jan60:12:27:05
Thanks,
Luca
Excel counts days from a different starting point. Excel stores time of day as a fraction of a day. You can use the DHMS() function to days (including fractional days) into datetime.
data test;
datetime=dhms('30DEC1899'd+44824.689149,0,0,0);
format datetime datetime19.;
run;
317 data test; 318 datetime=dhms('30DEC1899'd+44824.689149,0,0,0); 319 format datetime datetime19.; 320 put datetime=; 321 run; datetime=20SEP2022:16:32:22
Excel counts days from a different starting point. Excel stores time of day as a fraction of a day. You can use the DHMS() function to days (including fractional days) into datetime.
data test;
datetime=dhms('30DEC1899'd+44824.689149,0,0,0);
format datetime datetime19.;
run;
317 data test; 318 datetime=dhms('30DEC1899'd+44824.689149,0,0,0); 319 format datetime datetime19.; 320 put datetime=; 321 run; datetime=20SEP2022:16:32:22
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.