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>
    <title> Sample </title>
    <h1> Example </h1>
  var dt = Date();
  document.write("DateTime :   " + dt);

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