Javascript Date Methods

Javascript Date Methods

Date function with other user defined function.

<html>
<head>
<title></title>
<script>
show();
function show()
{
var date = new Date();
var hour=date.getHours();
var min=date.getMinutes();
var month=date.getMonth()+1;
var day= date.getDate();
var year=date.getFullYear();

display();
function display(){

if (hour>=22 || hour <=5)
document.write(“Hello, world”);
else
document.write(“Today is ” +month+”/”+day + “/” +year +”<br/>”);
document.write(“The Current time is ” + hour + ” : ” + min);

}
}

</script>
</head>
<body>
</body>
</html>




Follow Us

Contact Us

tutorialworldin@yahoo.com

Back to Top