Wirelessly posted (Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_3_3 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8J2 Safari/6533.18.5)
Pm me your HTML file and I'll fix it for you!
jjk454ss said:to make it work add "Pad the minutes and seconds with leading zeros, if required" script AFTER the "Convert 24hr to 12hr "(or something along those lines) to look EXACTLY like this:
Code:<!-- Convert the hours component to 12-hour format if needed --> currentHours = ( currentHours > 12 ) ? currentHours - 12 : currentHours; <!-- Pad the minutes and seconds with leading zeros, if required currentHours = ( currentHours < 10 ? "0" : "" ) + currentHours; currentMinutes = ( currentMinutes < 10 ? "0" : "" ) + currentMinutes; currentSeconds = ( currentSeconds < 10 ? "0" : "" ) + currentSeconds;
SAVE AND RESPRING
I think it would go in/under here, but I can't get it to work. Thank you for helping me, sorry I'm just not getting it though. I'm really a newbie when it comes to HTML:
Code:/*---------------------------------------------------------------------------------------------------------------------------------AM PM Edit------*/ /* Remove the /* from under this line to display am or pm after the 12 hours clock */ /* NEW!! */ // Choose either "AM" or "PM" as appropriate var timeOfDay = ( currentHours < 12 ) ? "AM" : "PM"; // Convert the hours component to 12-hour format if needed currentHours = ( currentHours > 12 ) ? currentHours - 12 : currentHours; // Convert an hours component of "0" to "12" currentHours = ( currentHours == 0 ) ? 12 : currentHours; // Compose the string for display var currentTimeString = timeOfDay; // Update the time display document.getElementById("ampm").firstChild.nodeValue = currentTimeString; }
Pm me your HTML file and I'll fix it for you!