Showing posts with label Date And Time in Master Page Using Java Script. Show all posts
Showing posts with label Date And Time in Master Page Using Java Script. Show all posts

Monday, June 23, 2014

Date And Time in Master Page Using Java Script

<head runat="server">
<title>JavaScript display current time on webpage</title>
<script type="text/javascript">
function ShowCurrentTime() {
var dt = new Date();
document.getElementById("lblTime").innerHTML = dt.toLocaleTimeString();
window.setTimeout("ShowCurrentTime()", 1000); // Here 1000(milliseconds) means one 1 Sec  
}
</script>
</head>
<body onload="ShowCurrentTime()">
<form id="form1" runat="server">
<div>
JavaScript Display current time second by second.
<label id="lblTime" style=" font-weight:bold"></label>
</div>
</form>
</body>

</html>