Digital clock tweaks

Hi,

I used J.E. aka IamNot Jubba’s Digital Clock tutorial to create 4 different world clocks. I tweaked his code to make each clock 24-hour (military time), then I offset each clock for 4 different locations (+0 hours for SF, +7 hours for UK, +9 for SA, +3 for NYC). Check out the code for SA:

onClipEvent (enterFrame) {
myTime = new Date();
nSeconds = myTime.getSeconds();
nMinutes = myTime.getMinutes();
nHours = myTime.getHours() + 9;

if (length(nMinutes) == 1) {
    nMinutes = "0"+nMinutes;
}
if (length(nSeconds) == 1) {
    nSeconds = "0"+nSeconds;
}
nTime = nHours+":"+nMinutes+":"+nSeconds;

}

My question is how to adjust the code so the hours don’t “break” after 23:00 hours (11pm in regular time). For example if it’s 4:00pm in South Africa, my clock incorrectly displays 31:00- it should read 16:00. I tried adding this line but no go:

if (nHours>=23) {
nHours = nHours-9;
}

Any math/flash geniouses out there wanna take crack at this? I’d really appreciate any help.

Thanks!
tcg