Working with dates in javascript
To create date object in JavaScript use Date() constructor The following example writes the current Date and Time to the web page document.write(new Date()); If the Date() constructor is used without any arguments, it returns the current date and time. To create a date object with specific dates there are 2 ways. Creating a specific date object in JavaScript using a date string var dateOfBirth = new Date("January 13, 1980 11:20:00"); document.write(dateOfBirth); You can also create a specific date object using number for year, month, day, hours, minutes, seconds, & milliseconds.