# Digital Clock by E.J. aka IamNotJubba

**URL:** <https://forum.kirupa.com/t/digital-clock-by-e-j-aka-iamnotjubba/282215>\
**Category:** Uncategorized\
**Created:** [February 19, 2009, 2:59am UTC](https://forum.kirupa.com/t/digital-clock-by-e-j-aka-iamnotjubba/282215 "2009-02-19T02:59:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![geraldyeong](https://avatars.discourse-cdn.com/v4/letter/g/f4b2a3/32.png) [@geraldyeong](https://forum.kirupa.com/u/geraldyeong)\
**Post date:** [February 19, 2009, 2:59am UTC](https://forum.kirupa.com/t/digital-clock-by-e-j-aka-iamnotjubba/282215/1 "2009-02-19T02:59:22Z")

</div>

Help ! I have followed the steps for this tutorial.

I encountered a very weird problem.

This is the code from the tutorial :

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

It was fine last night, as soon as i opened up the file today, which is at 10:54 AM. Everything screwed up, it became -2:54:30 PM. Can anyone help me with this ? Let me also upload the file too! All help is appreciated !
