Advertisement
WindowsTV

Untitled

Apr 10th, 2017
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var day_date:Date = new Date();
  2. var day = day_date.getUTCDay();
  3. var days_of_the_week = new Array("sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday");
  4. function getDay()
  5. {
  6.     var _loc1 = days_of_the_week[day];
  7.     return(_loc1.toUpperCase());
  8. }
  9. this.onEnterFrame = function()
  10. {
  11.     time = new Date();
  12.     var minutes = time.getUTCMinutes();
  13.     var hours = time.getUTCHours();
  14.     hours = hours - 7;
  15.  
  16.     if (hours < 0)
  17.     {
  18.         var mynew_date:Date = new Date();
  19.         var daynew = mynew_date.getUTCDay();
  20.         var daymaths = daynew - 1;
  21.         var date_day = getDay(daymaths);
  22.         var newhours = hours + 1;
  23.         hours = 23 + newhours;
  24.     }
  25.     if (hours < 10)
  26.     {
  27.         hours = "0" + hours;
  28.     }
  29.     if (minutes < 10)
  30.     {
  31.         minutes = "0" + minutes;
  32.     }
  33.     if (hours >= 12)
  34.     {
  35.         var ampm = "PM";
  36.         var hours = hours - 12;
  37.     }
  38.     else if (hours > 12)
  39.     {
  40.         var hours = hours - 12;
  41.     }
  42.     else if (hours = "00")
  43.     {
  44.         var hours = 12;
  45.         var ampm = "AM";
  46.     }
  47.     else
  48.     {
  49.         var ampm = "AM";
  50.     }
  51.     trace(ampm);
  52.     trace(hours + ":" + minutes);
  53.     trace(date_day.toUpperCase());
  54. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement