js built-in objects common method

Date object:

Set date:

new Date("month dd,yyyy hh:mm:ss");
new Date("month dd,yyyy");
new Date(yyyy,mth,dd,hh,mm,ss);
new Date(yyyy,mth,dd);
new Date(ms);

Creation date object -------------- new Date ();

One day a month ---------- getDate () 1-31

Day of the week -------------- getDay () 0-6 to add the actual date of 1

A year of monthly -------------- getMonth () 0-11 actual date to add 1

Hours ------------------------ getHours ()

Minute ---------------------------- getMinutes ()

Second -------------------------------- getSeconds ()

Obtain the original value -------------------------- valueOf ()

Provided the original value --------------------------- getTime ()

Guess you like

Origin www.cnblogs.com/cui-ting/p/11245937.html