11-28-2012 10:28 AM
Since time is just the number of seconds since midnight, you just have to divide by 60*60. Although, doing that would give you 13.25 rather than 1.25, but would allow you to differentiate between 1:15am and 1:15pm.
informat dt anydtdtm21.;
11-18-2015 04:36 PM
This worked closer to my problem without the formatting:
NOTE. My field "Hours" was formatted as time5.
So hours 1:55 became 1.9166666667
11-28-2012 03:27 PM
or fractiontime = hour(datetimevariable) + minute(datetimevariable)/60;
if you don't want hour 13 to 23, ignoring AM/Pm
fractiontime = mod(hour(datetimevariable),12) + minute(datetimevariable)/60;
11-28-2012 03:53 PM
Perhaps you want HOUR format http://support.sas.com/documentation/cdl/en/leforinforref/63324/HTML/default/viewer.htm#p1ajv0kbaa42...
you will need to separate the time from the datetime.