1, Date.parse (): Receives a string parameter that represents a date, and then attempts to return the number of milliseconds of the corresponding date based on the string. such as "6/13/2015", "January 12,2014", "Tue May 2004 00:00:00 GMT-0700", "2004-05-25t00:00:00"
2. Get start time and stop time
var start=date.now ();
DoSomething ();
var stop=date.now ();
Result=stop-start;
3. Use + to convert a Date object to a string
var start = +new Date ();
DoSomething ();
var stop= +new Date ();
result = Stop start;
4, toLocaleString ()
5. ToString ()
6, ValueOf ()//returns the number of seconds, often used to compare
Method of date formatting
7. toDateString () displays weekday, month, day, and year in an implementation-specific format.
8. toTimeString () Displays hours, minutes, seconds, and time zones in an implementation-specific format
9. toLocaleDateString () displays weekday, month, day, and year in a locale-specific format.
10. toLocaleTimeString () Displays hours, minutes, seconds in an implementation-specific format
11. toUTCString () full UTC date in implementation-specific format
Date/Time Component method
12, GetTime () returns the number of milliseconds representing the date; same as valueof ()
13, SetTime (milliseconds) set the date in milliseconds and change the entire date
14, getFullYear () 4-digit year
15, getUTCFullYear () returns the 4-digit year of the UTC date
16, setFullYear (year) set the year of the date, must be a 4-digit number
17, setUTCFullYear (year)
18, GetMonth () returns the month of the date, where 0 represents January, 11 means December
19, getUTCMonth ()
20, Setmonth ()
21, setUTCMonth ()
22, GetDate () returns the number of days in the date month (1~31)
23, getUTCDate ()
24, SetDate (day)
25, SetUTCDate (day)
26, GetHours () (0~23)
27, getUTCHours ()
28, Sethours ()
29, setUTCHours ()
30, getminutes ()
31, getUTCMinutes ()
32, setminutes (min)
33, setUTCMinutes (min)
34, Getseconds ()
35, getUTCSeconds ()
36, Setseconds ()
37, setUTCSeconds ()
38, Getmilliseconds ()
39, getUTCMilliseconds ()
40, Setmilliseconds (MS)
41, setUTCMilliseconds ()
42, getTimezoneOffset () returns the number of minutes between local time and UTC time.
The date of JavaScript