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

**URL:** <https://forum.kirupa.com/t/desperate-what-is-wrong-with-my-code-works-in-flash-6/170901>\
**Category:** Uncategorized\
**Created:** [November 30, 2005, 11:06am UTC](https://forum.kirupa.com/t/desperate-what-is-wrong-with-my-code-works-in-flash-6/170901 "2005-11-30T11:06:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![duke\_vim](https://avatars.discourse-cdn.com/v4/letter/d/ee59a6/32.png) [@duke\_vim](https://forum.kirupa.com/u/duke_vim)\
**Post date:** [November 30, 2005, 11:06am UTC](https://forum.kirupa.com/t/desperate-what-is-wrong-with-my-code-works-in-flash-6/170901/1 "2005-11-30T11:06:00Z")

</div>

```auto
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. 🙂
