In order to use the properties and methods of Date the Date must be created. Date objects are created using new Date(), e.g.
var Thedate = new Date(); var Day = Thedate.getDate(); alert (Day);
This code will display today’s date.
var Thedate = new Date(); var Month = Thedate.getMonth(); alert (Month);
This code will display the month.
Examples of Date usage are setting the date and time and finding the day, month, year and time from the system. There are many other Date functions available.