{{theTime}}

Search This Blog

Total Pageviews

Java Script to display Current date and time Example

<!DOCTYPE html>
<html>
<head>
<script>
function showDateTime() {
    var today = new Date();
    var hour = today.getHours();
    var minute = today.getMinutes();
    var second = today.getSeconds();
    minute = checkTime(minute);
    second = checkTime(second);
    document.getElementById('datetime').innerHTML =
    hour + " : " + minute  + " : " + second;
    var time= setTimeout(startTime, 500);
}
function checkTime(i) {
    if (i < 10) {i = "0" + i};  
    return i;
}
</script>
</head>

<body onload="showDateTime()">

<div id="datetime"></div>

</body>
</html>

No comments:

Cucumber Eclipse sample program

Cucumber Eclipse SetupCreate Eclipse Maven Project Open pom.xml Goto Dependencies Add GroupId: info.cukes, Artifact Id: cucumber-java, Versi...