home *** CD-ROM | disk | FTP | other *** search
/ PC User 2001 August / APC_Aug2001_CD2.iso / features / devtools / files / lb202win.exe / LB202W.EXE / AMPMTIME.BAS next >
Encoding:
BASIC Source File  |  2000-02-21  |  397 b   |  18 lines

  1.  
  2. print amPmTime$(time$())
  3.  
  4. function amPmTime$(time$)
  5.  
  6.     colonIndex = instr(time$, ":")
  7.     hours = val(left$(time$, colonIndex - 1))
  8.     amOrPm$ = " AM"
  9.     if hours > 12 then
  10.             hours = hours - 12
  11.             amOrPm$ = " PM"
  12.         else
  13.             if hours = 0 then hours = 12
  14.     end if
  15.     amPmTime$ = str$(hours) + mid$(time$, colonIndex) + amOrPm$
  16.  
  17. end function
  18.