34,333
edits
Changes
→Creating a JavaScript Date Object
== Creating a JavaScript Date Object ==
A javaScript Date Object is created much like any other object in JavaScript, using the ''new'' keyword and some optional arguments (for an overview of Objects in JavaScript see [[JavaScript Object Basics]]). The syntax for creating an instance of a Date object is as follows: var myDate = new Date(''Optional Parameters''); The following examples show the different ways of creating and initializing a Date object instance: