Guest User

Untitled

a guest
Oct 6th, 2018
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. string ConvertWallclockToTime()
  2. {
  3.     //llSay(0, ConvertWallclockToTime());
  4.     integer now = (integer)llGetWallclock();
  5.     //now += 43200;
  6.     integer seconds = now % 60;
  7.     integer minutes = (now / 60) % 60;
  8.     integer hours = now / 3600;
  9.     if(now <= 43200)
  10.     {
  11.         return llGetSubString("0" + (string)hours, -2, -1) + ":"
  12.             + llGetSubString("0" + (string)minutes, -2, -1) + ":"
  13.             + llGetSubString("0" + (string)seconds, -2, -1) + ":AM";
  14.     }
  15.     else
  16.     {
  17.         if(now >= 43200 + 3600)
  18.         {
  19.             return llGetSubString("0" + (string)hours, -2, -1) + ":"
  20.                 + llGetSubString("0" + (string)minutes, -2, -1) + ":"
  21.                 + llGetSubString("0" + (string)seconds, -2, -1) + ":PM";
  22.         }
  23.         return llGetSubString("0" + (string)(hours - 12), -2, -1) + ":"
  24.             + llGetSubString("0" + (string)minutes, -2, -1) + ":"
  25.             + llGetSubString("0" + (string)seconds, -2, -1) + ":PM";
  26.     }
  27.  
  28. }
Add Comment
Please, Sign In to add comment