Search notes:
SAS: Comparison of time formats hhmm, time and tod
The hhmm.
format hours and minutes only. No seconds (but fractions of a minute). No leading zero.
The
time
format is able to additionally print seconds and fractions of seconds - also without leading zero.
The tod
format is like the time
format, yet it prints a leading zero if the hour is less than 10.
data _null_;
h05_m16_32s = 5 * 60 * 60 +
16 * 60 +
32 +
16/100;
put h05_m16_32s hhmm. ; /* 5:17 */
put h05_m16_32s tod. ; /*05:16:32 */
put h05_m16_32s time. ; /* 5:16:32 */
put h05_m16_32s hhmm11. ; /* 5:17 */
put h05_m16_32s tod11. ; /* 05:16:32 */
put h05_m16_32s time11. ; /* 5:16:32 */
put h05_m16_32s hhmm11.2; /* 5:16.54 Note: .54 is a fraction of a minute. */
put h05_m16_32s tod11.2 ; /*05:16:32.16 */
put h05_m16_32s time11.2; /* 5:16:32.16 */
run;