English
<!-- Saved From url=http://www.downcodes.com/js --> <!-- Web Design bbs url=http://www.downcodes.com/bbs--> <!--Required There are two steps required to achieve this effect. The first step is to add the following code to the <head> area --> <SCRIPT LANGUAGE="JavaScript"> <!-- Begin function doFormalTime() { var myTime = new Date(); var myHour = myTime.getHours(); var myMinutes = myTime.getMinutes(); var ampm = "morning"; if (myHour >= 12) { myHour -= 12; // change to PM ampm = "pm"; } Hour = new Array( "One o'clock", "Two o'clock", "Three o'clock", "Four o'clock", "Five o'clock", "Six o'clock", "Seven o'clock", "Eight o'clock", "Nine o'clock", " Ten o'clock", "eleven o'clock", "twelve o'clock"); myMin = myMinutes - (myMinutes % 5); if (myMinutes % 5 > 2) myMin += 5; var text = "The estimated time now is: "; switch(myMin) { case 0 : myHour--; break; case 5 : text += "zero five points"; myHour--; break; case 10 : text += "ten points"; myHour--; break; case 15 : text += "fifteen points"; myHour--; break; case 20 : text += "twenty points"; myHour--; break; case 25 : text += "twenty-five"; myHour- -; break; case 30 : text += "Thirty minutes"; myHour--; break; case 35 : text += "Twenty-five minutes short"; break; case 40 : text += "Twenty-five minutes short" ; break; case 45 : text += "Fifteen points off"; break; case 50 : text += "Ten points off"; break; case 55 : text += "Fifteen points off"; break; case 60 : break; } if (myHour < 1) myHour++; if (ampm == "pm") { ampm = (myHour >= 4) ? "evening" : "noon"; } text += ampm + Hour[myHour]; return text; } // End --> </script> <!--Step 2: Add the following code to the <body> area --> <script> document.write(doFormalTime()); </script>