var mydate=new Date();
This will create a new date object that is set to the current date and time of you local machine. If you want to create a new date object and set it to date and time of own your choice you can supply the date and time values as shown below:
var mydate=new Date("01 January 2012");
This date object will set to the first of January 2012.
Another way to create a date object and initialize date and time values is to supply those values(year, month, day, hour, minute, second, millisecond) as seen below:
var mydate=new Date(2012,01,01,12,30,20);
The subsequent parts of this topic we will discuss about methods used to work with date and time values.
This website intents to provide free and high quality tutorials, examples, exercises and solutions, questions and answers of programming and scripting languages: