TIME$ Function Programming Example The following example converts the 24-hour time returned by TIME$ to a 12-hour time. 'Convert the 24-hour clock used by TIME$ to '12-hour output followed by "AM" or "PM." T$ = TIME$ Hr = VAL(T$) IF Hr < 12 THEN Ampm$ = " AM" ELSE Ampm$ = " PM" IF Hr > 12 THEN Hr = Hr - 12 PRINT "The time is" STR$(Hr) RIGHT$(T$,6) Ampm$ Sample Output The time is 11:26:31 AM