{{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:

Generate Insert Sql from Select Statement

SELECT 'INSERT INTO ReferenceTable (ID, Name) VALUES (' +        CAST(ID AS NVARCHAR) + ', ''' + Name + ''...