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

JavaScript toString() Method


Date Object Reference JavaScript Date Object

Definition and Usage

The toString() method converts a Date object to a string.

Syntax

dateObject.toString()


Example

Example

Convert today's date into a string:

<script type="text/javascript">

var d=new Date();
document.write (d.toString());

</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)