SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    Mar 2008
    Posts
    135
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Multiple Flash Clocks displaying different time zones?

    Hello. I have some code below. This was a tutorial that someone showed online.

    Code Actionscript:
    //File downloaded from [url]www.riacodes.com[/url]
     
    stage.addEventListener(Event.ENTER_FRAME,updateDate);
     
     
    function updateDate(e:Event):void{
    	var date = new Date();
     
    	if (date.hours< 10){	
    		hours_t.text = "0" + date.hours;
    	} 
    	else {
    		hours_t.text = date.hours;
    	}
     
    	if (date.minutes< 10){	
    		minutes_t.text = "0" + date.minutes;
    	}
    	else {
    		minutes_t.text = date.minutes;
    	}
     
    	if (date.seconds< 10){	
    		seconds_t.text = "0" + date.seconds;
    	} 
    	else {
    		seconds_t.text = date.seconds;
    	}
    }

    I would like to be able to set this clock up in a different time zone, say...minus 1 hour.

    So ultimlately it will be 3 total clocks on my map showing east coast, central time and west coast.


    Thanks.

  2. #2
    Community Advisor silver trophy

    Join Date
    Nov 2006
    Location
    UK
    Posts
    2,547
    Mentioned
    40 Post(s)
    Tagged
    1 Thread(s)
    Your best to load a base time from your server rather than depend on the user's clock which may be set innaccurately (your server's may be too but at least you can control this or compensate for it)


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •