new Date(date string)

Using new Date(date string), creates a new date object from the specified date and time:

HTML file: Displayed by browser:
<body>
<p id="demo"></p>

<script>
var d = new Date("October 13, 2014 11:13:00");
document.getElementById("demo").innerHTML = d;
</script>
</body>

Valid date strings (date formats) are described later in the tutorial.

BackTable of ContentsNext