Keith130
July 6th, 2003, 02:04 PM
I have the following AS on a frame :
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();
}
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.
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();
}
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.