Javascript language

adplus-dvertising
Digital clock in the status line
Previous Home Next

How to show a digital clock in the status line

Step 1. Written below code in your application.

<html>
<body onload="displyTime_inStatusLine()">
<script language="javascript">
function displyTime_inStatusLine()
{
    var d = new Date();                
    var h = d.getHours();              
    var m = d.getMinutes();            
    var ampm = (h >= 12)?"PM":"AM";    
    if (h > 12) h -= 12;              
    if (h == 0) h = 12;                
    if (m < 10) m = "0" + m;           
    var t = h + ':' + m + ' ' + ampm;  
    defaultStatus = t; 
    setTimeout("displyTime_inStatusLine()", 60000); 
}
</script>
</body>
</html>

Step 2. Run the Application.

l
Previous Home Next