# Time stuck on PM

**URL:** https://forum.kirupa.com/t/time-stuck-on-pm/47039
**Category:** Uncategorized
**Created:** [March 30, 2004, 1:36pm UTC](https://forum.kirupa.com/t/time-stuck-on-pm/47039 "2004-03-30T13:36:09Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![ken](https://avatars.discourse-cdn.com/v4/letter/k/cc9497/32.png) [@ken](https://forum.kirupa.com/u/ken)
#### Post date: [March 30, 2004, 1:36pm UTC](https://forum.kirupa.com/t/time-stuck-on-pm/47039/1 "2004-03-30T13:36:09Z")

</div>

Hi my clock is working fine, the problem I having is its stay on PM I have to manualy change it to AM can some help me with it thanks.  
This is my script.

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