JavaScript Date Function

The JavaScript Date function is used to return the Current Date and Time. In this article, we show you how to use the Date method with an example.

JavaScript Date Function Example

The following JS example helps you understand this Function.

<!DOCTYPE html>
<html>
<head>
    <title> Sample </title>
</head>
<body>
    <h1> Example </h1>
<script>
  var dt = Date();
    
  document.write("DateTime :   " + dt);
</script>
</body>
</html>
Example

DateTime: The Nov 01 2018 11:32:39 GMT+0530 (Indian Standard Time)