PDA

Click to See Complete Forum and Search --> : Can anyone help with my clock problem?



studley
09-23-2002, 11:52 AM
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.

Ed Mack
09-24-2002, 12:07 PM
shouldn't
hour = hourtime + timezoneoffset();

be:
hour = hourtime + timezoneoffset;?

studley
09-24-2002, 12:09 PM
cheers for your help!! I knew it had to be something easy that I couldn't put my finger on!!