# Clock

**URL:** <https://forum.kirupa.com/t/clock/51677>\
**Category:** Uncategorized\
**Created:** [May 15, 2004, 4:27pm UTC](https://forum.kirupa.com/t/clock/51677 "2004-05-15T16:27:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ree\_Ree](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/ree_ree/32/545_2.png) [@Ree\_Ree](https://forum.kirupa.com/u/Ree_Ree)\
**Post date:** [May 15, 2004, 4:27pm UTC](https://forum.kirupa.com/t/clock/51677/1 "2004-05-15T16:27:48Z")

</div>

Hi me again! I’m trying to do the digital clock using the tutorial on the site, but without the day and time but I can’t seem to make it work, this is the script i’m using

onClipEvent (enterFrame) {  
myTime = new Date();  
nMinutes = myTime.getMinutes();  
nHours = nTime.getHours();  
if (nHours\>=12) {  
ampm = “pm”;  
}else{  
ampm = “am”  
}  
if (nHours\>=13){  
nHours = nHours-12  
}  
if (length(nMinutes)==1){  
nMinutes = “0”+nMinutes;  
}  
nTime = nHours+":"+nMinutes+""+ampm;  
}

any clues as to what i’m doing wrong? Thanks in advance!
