js function of time

Remarks (for additional date formats):

a Date new new DATE = var ();
Date.getYear (); // get the current year (2)
the Date.getFullYear (); // get the full year (4, 1970 - ????)
date.getMonth ( ); // get the current month (0-11,0 behalf January)
date.getDate (); // get the current day (1-31)
date.getDay (); // get the current week X (0-6, 0 for Sunday)
date.getTime (); // get the current time (number of milliseconds from the start 1970.1.1)
date.getHours (); // get the number (0-23) current hour
date.getMinutes (); // Get the current minute (0-59)
date.getSeconds (); // get the current number of seconds (0-59)
date.getMilliseconds (); // get the current milliseconds (0-999)
date.toLocaleDateString (); / / get the current date
var mytime = date.toLocaleTimeString (); // get the current time
date.toLocaleString (); // get the date and time

Guess you like

Origin www.cnblogs.com/guoyinghome/p/10962511.html