Analog Clock in flash with UTC +5:30... help !!!

Hi,

I created 8 different analog clocks and managed to run different timezones on them but still there is a glitch... I can add the timezones to the UTC like +4, -3 etc but dont know how to add +5:30 to it any ideas??? below is the piece of code i am using for implimenting different timezones.

clock2.onEnterFrame = function () {
clockDate = new Date();
seconds = clockDate.getUTCSeconds();
this.secondsHand._rotation = seconds * 6;
minutes = clockDate.getUTCMinutes();
this.minutesHand._rotation = minutes * 6;
hours = clockDate.getUTCHours();
hours = hours +(minutes/60);
hours = hours + 12;
this.hoursHand._rotation = (hours * 30)+(minutes/2);

}
ShabztAsked:
Who is Participating?
 
Aneesh ChopraConnect With a Mentor Commented:
Ok,
Here is the fixed code:

clock2.onEnterFrame = function()
{
      clockDate = new Date();
      seconds = clockDate.getUTCSeconds();
      this.secondsHand._rotation = seconds*6;
      minutes = clockDate.getUTCMinutes();
      // add minutes here
      minutes += 30;
      hours = clockDate.getUTCHours();
      hours = hours+(minutes/60);
      minutes = (minutes>=60) ? minutes-60 : minutes;
      // add hours here
      hours = hours+5;
      this.minutesHand._rotation = minutes*6;
      this.hoursHand._rotation = (hours*30)+(minutes/2);
};
0
 
Aneesh ChopraCommented:
just add 5.5 into hours..

-------------------
Aneesh Chopra
-------------------
0
 
ShabztAuthor Commented:
adding 5.5 works in javascript, but i have already tried adding 5.5 in actionscript it doesn't give the desired output.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.