[Desperate] What is wrong with my code? Works in Flash 6

onClipEvent (enterFrame) {
	myTime = new Date();
	nSeconds = myTime.getUTCSeconds();
	nMinutes = myTime.getUTCMinutes();
	nHours = myTime.getUTCHours();
	if (hours>=12) {
		ampm = "pm";
	} else {
		ampm = "am";
	}
	if (hours>=13) {
		nHours = nHours-12;
	}
	if (length(nMinutes) == 1) {
		nMinutes = "0"+nMinutes;
	}
	if (length(nSeconds) == 1) {
		nSeconds = "0"+nSeconds;
	}
	nTime = nHours+":"+nMinutes+":"+nSeconds+" "+ampm;
}

My time comes out as “-1:09:09” (obviously depending on the time) - where is the dash at the front coming from? Why only in Flash 7+, not in 6, no matter what AS version is used.

Please help me, I’m going out of my tiny mind. :slight_smile: