Advertisement
CaptainLepidus

Time

Feb 23rd, 2012
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. {
  2.     var h,m;
  3.     if sign( ts ) == 1
  4.     {
  5.         t = tt * 7.2;
  6.         h = floor( t / 60 );
  7.         m = floor( t - h * 60 );
  8.         if h == 0
  9.         {
  10.             h = 12;
  11.         }
  12.         rh = string( h );
  13.         if real( rh ) < 10
  14.         {
  15.             rh = '0' + string( h );
  16.         }
  17.         rm = string( m );
  18.         if real( rm ) < 10
  19.         {
  20.             rm = '0' + string( m );
  21.         }
  22.         return rh + ':' + rm + 'PM';
  23.     }
  24.     else
  25.     {
  26.         t = ( 100 - tt ) * 7.2;
  27.         h = floor( t / 60 );
  28.         m = floor( t - h * 60 );
  29.         if h == 0
  30.         {
  31.             h = 12;
  32.         }
  33.         rh = string( h );
  34.         if real( rh ) < 10
  35.         {
  36.             rh = '0' + string( h );
  37.         }
  38.         rm = string( m );
  39.         if real( rm ) < 10
  40.         {
  41.             rm = '0' + string( m );
  42.         }
  43.         return rh + ':' + rm + 'AM';
  44.     }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement