The following code line defines a Date object called myDate:var myDate=new Date()
When creating a Date object based on the computer’s (not web server’s!) internal clock, it is important to note that if someone’s clock is off by a few hours or they are in a different time zone, then the Date object will create a different time than the one created with your own computer.
The Date object has been created and now we have a variable that holds the current date. To get the information we need to print out the date we have to utilize some or all of the following functions:
Now we can print out the date information. We will be using the getDate, getMonth, and getFullYear methods in this example.
It is now 9/13/2017