Tutorials Point


  JavaScript Basics
  JavaScript Objects
  JavaScript Advanced
  JS Useful References
  JS Useful Resources
  Selected Reading

Copyright © 2014 by tutorialspoint



  Home     References     Discussion Forums     About TP  

Javascript Date() Method


previous next AddThis Social Bookmark Button


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:

  • NA

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 Printer Friendly

Advertisements


  

Advertisements