◄Example► ◄Contents► ◄Index► ◄Back► ────────────────────────────────────────────────────────────────────────────── 'This example converts the 24-hour clock used by the TIME$ function 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