A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Can anyone help with my clock problem?

  1. #1
    Junior Member
    Join Date
    Oct 2000
    Posts
    24
    Can anybody help me?
    I am trying to build a clock into my website that only displays the time at the GMT timezone. I am using Flash MX. I have a movie clip with three dynamic text boxes, called: hour, min, and sec.
    On the first frame of this Movie Clip, I have written this code:

    /***Set Time***/

    d = new Date();
    hourtime = d.getUTCHours();
    timezone = d.getTimezoneOffset();
    timezoneoffset = -(timezone/60);
    hour = hourtime + timezoneoffset();
    min = d.getMinutes();
    sec = d.getSeconds();


    /*** Leading Zeroes Setup***/

    if (length(min) == 1) {
    min = "0" + min;
    }
    if (length(sec) == 1) {
    sec = "0" + sec;
    }

    /****end****///

    However, as here in the UK we are currrently in daytime saving mode, we are 1 hour ahead of GMT, hence the use of the timezoneoffset variable, I get the time displayed with this result, and it is GMT time, regardless of what timezone I set the pc clock to, however I can't get it to adjust for the 1 hour offset. I'd be greatly obliged to anyone who could help me with this.

  2. #2
    Gross Pecululatarian Ed Mack's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    2,954
    shouldn't
    hour = hourtime + timezoneoffset();

    be:
    hour = hourtime + timezoneoffset;?

  3. #3
    Junior Member
    Join Date
    Oct 2000
    Posts
    24
    cheers for your help!! I knew it had to be something easy that I couldn't put my finger on!!

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center