Copyright © tutorialspoint.com

Javascript Date() Method

previous next

Advertisements


Description:

Javascript Date() method returns today's date and time and does not need any object to be called

Syntax:

Date()

Here is the detail of parameters:

Return Value:

Returns today's date and time

Example:

<html>
<head>
<title>JavaScript Date Method</title>
</head>
<body>
<script type="text/javascript">
   var dt = Date();
   document.write("Date and Time : " + dt ); 
</script>
</body>
</html>

This will produce following result:

Date and Time : Wed Aug 27 2008 20:12:50 GMT+0530 
                (India Standard Time)

To understand it in better way you can Try it yourself.


previous next

Copyright © tutorialspoint.com