The JavaScript Date object can be used to create a date in four different ways:
1) Create a date based on the client machine date and time. To accomplish this, create a new Date object passing no parameters, as follows:
var dteNow = new Date();
document.write(dteNow);
2) Create a date by passing the Date object the number of milliseconds beyond 1 January 1970 00:00:00:
var dteNow = new Date(179751121110);
document.write(dteNow);
3) Create a date by passing the Date object a date string recognizable by the date parser:
var dteNow = new Date('September 12, 1975 03:52:01');
document.write(dteNow);
4) Create a date by passing the Date object a series of integer values, representing date parts, in the order of year, month, day, hour, minute, second, millisecond. Months are indexed starting at 0.
var dteNow = new Date(1975,8,12,3,52,1,10);
document.write(dteNow);
Please note that not all the date parts need to be passed into the Date object. A date can be created with a minimum of a year and month argument:
var dteNow = new Date(1975,8);
document.write(dteNow);