1 Date principle
The date type represents time, and JS uses UTC international coordination time, starting from January 1, 1971 0 minutes 0 seconds 0 microseconds, elapsed milliseconds to represent time, such as a year's time calculation
1 points: 1000*60;
1 Hours: 1000 (ms) *60*60;
1 year: 1000*60*60*24*365=31 536 000 000, if 1000 years is added directly 000, this is JS in the time of the expression principle
2 Conversion
Resolves a string to a time
Date.parse (): The function will parse a date similar to: ' 6/23/2005 ', if it does not successfully return Nan;
Then using the var date=new date (), the constructor constructs a new Date object, and you can actually use the date string directly as the dates constructor parameter: var date=new date (' 2/19/2002 ');
In fact, the native JS on time conversion and formatting ability are very weak, their main calculations are in milliseconds, the general format and conversion are implemented through a number of CDN Tool Library, of course, they are by the date of the addition of the prototype method to achieve
For example, date.prototype.formart=function (value) {return '};
3 The methods provided
These methods are the basis of date formatting
Redo JS Virtuoso four bullets: Date