From http://www.w3schools.com (Copyright Refsnes Data)

JavaScript Date() Method


Date Object Reference JavaScript Date Object

Definition and Usage

The Date() method returns today's date and time.

Syntax

Date()


Example

Example

The following example prints today's date and time:

<script type="text/javascript">

document.write(Date());

</script>

The output of the code above will be:


Try it yourself »


Date Object Reference JavaScript Date Object

From http://www.w3schools.com (Copyright Refsnes Data)