Date type
The date type in JavaScript is built on the Java.util.Date class in Java and uses UTC time to save the data to 285,616 years before or after January 1, 1970
Create a Date object that uses the new keyword with a constructor declaration (the date object is also a reference type), and the new object automatically gets the current date and time without passing any arguments to the constructor, as follows:
var nowtime=New//Ed 13:31:12 gmt+0800 (China Standard Time)
There are two ways to create a Date object based on a specific date and time: Date.parse () and DATE.UTC ()
Date.parse (): Parses a string that contains a date and returns the number of milliseconds between that date and midnight January 1, 1970.
var datestring= "November 1, 1997 10:15 AM" var mSec = date.parse (datestring); document.write (MSEC); // output:878404500000
The Date.parse () function returns an integer value that represents the number of milliseconds between the date provided in Dateval and the midnight of January 1, 1970.
JavaScript reference type (ii)