Show date and time help of JavaScript.
Output :
Show date and time help of JavaScript.
Date : dd/mm/yyyy
Time : hh:mm:ss
Long Process :
Light Process :
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Show date and time help of JavaScript</title>
</head>
<body>
<h1 align="center">Show date and time help of JavaScript.</h1>
<script>
var date = new Date();
document.write("Date : ")
document.write(date.getDate())
document.write("/")
document.write(date.getMonth())
document.write("/")
document.write(date.getFullYear())
document.write("<br>")
document.write("Time : ")
document.write(date.getHours())
document.write(":")
document.write(date.getMinutes())
document.write(":")
document.write(date.getSeconds())
</script>
</body>
</html>
Light Process :
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Show date and time help of JavaScript</title>
</head>
<body>
<h1 align="center">Show date and time help of JavaScript.</h1>
<script>
var date = new Date();
document.write("Date : "+date.getDate()+"/"+date.getMonth()+"/"+date.getFullYear())
document.write("<br>") document.write("Date : "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds())
</script>
</body>
</html>
Comments
Post a Comment