Posted: 18th Feb 2004 10:49
Displays the time in 12 hour notation instead of 24 hour military time. Again, another old snippet from years back.

+ Code Snippet
sync on

do
`cls
  set cursor 0,0
  print formatted_time()

  if spacekey() then exit
sync
loop




function formatted_time()
  hour$=left$(get time$(),2)
  day$="am"
  if val(hour$)>=12 then day$="pm"
  if val(hour$)>12 then hour$=str$((val(hour$)-12))
  if val(hour$)=0 then hour$="12"
  minutes$=mid$(get time$(),4)+mid$(get time$(),5)
  ft$=hour$+":"+minutes$+day$
endfunction ft$