I have the following AS on a frame :
[AS]
stop();
myDate = new Date();
myTime = new Date();
_root.main.txtDate = myDate.getUTCDate()+" / “+myDate.getUTCMonth+” / “+myDate.getFullYear();
changeDate = setInterval(timeChange, 10);
function timeChange() {
_root.main.txtTime = myTime.getUTCHours()+”:"+myTime.getUTCMinutes()+"."+myTime.getUTCSeconds();
}[/AS]
It worksish and gives a date but the date is “6/6/2003” and the time is “18:3:4”. AS you can see both the month and the hour are one short. I tired setting a variable as ther month and addin one to it but the output was NaN.
Oh and the setInterval doesnt change the time?? Any ideas about that?
Thanx in advance if you can help.
Thanx both of you, Now I see where I went wrong adding 1 to the month and hour. I nerver thought of declaring a new date everytime inside the function. I suppose it was like my Drag and Drop while easeing thing that I needed a function inside the button.onPress to update the targetX and targetY. Thanx again.
PinnedBot sorry that I ask you, but Isnt it the same if you use myDate.[COLOR=blue]getUTCHours/COLOR or
[COLOR=black]new[/COLOR] [COLOR=blue]Date/COLOR.[COLOR=blue]getUTCHours/COLOR? I was thinking it is the same thing but as I see there is difference…Ihave also problem with digital world clock thats why Im asking.