Connecting Tech Pros Worldwide Help | Site Map

Digital Clock

Newbie
 
Join Date: Aug 2008
Posts: 1
#1: Aug 26 '08
I created Digital Clock.In that I want to display the Timezones of different countries when the user selects the particular zone...please help me how to get the time zones.......
Newbie
 
Join Date: Oct 2008
Location: Earth
Posts: 29
#2: Nov 3 '08

re: Digital Clock


You will need to add or subtract the appropriate amount of hours from the current time.
joedeene's Avatar
Site Addict
 
Join Date: Jul 2008
Location: US of A
Posts: 587
#3: Nov 3 '08

re: Digital Clock


You are using dynamic text boxes to display your time right? I don't know if you are using different ones for the Hour and Minutes, which I would suggest, because if so, like Fabez has said, you can add the number of hours from the currently selected timezone. Here's a code sample that worked for me, just change the hour, and make an If Else statement like if the hour is greater than 24 then set it to 0, after tracking how many numbers have been subtracted already.

Expand|Select|Wrap|Line Numbers
  1. var currenttimezone:Number = 0;
  2. var timezonehourtoadd:Number = 5;
  3. myHourDynamicTextBox.text = currenttimezone+timezonehourtoadd;
  4.  
...if you need further assistance let me know, and if you could post some part of what you have coded we could assist in a manner useful to you.

joedeene
Reply