Take value
This.divEndDate.attr ("Value", New Date ());
var date = new Date ();
Date.getyear (); Take 2-digit years
Date.getfullyear (); Take 4-digit years
Date.getmonth (); Take the Month
Date.getdate (); Take the day
Date.gettime (); Take the current time (millisecond value)
Date.gethours (); Take the current hour
Date.getminutes (); Take the current minute
Date.getseconds (); Take the current second
Date.getmilliseconds (); Take current millisecond (0-999)
Date.tolocaletimestring () Take time (12:12:12)
Date.tolocalestring () Pick up date and time (May 24, 2014 12:12:12)
Convert standard Time format information-2017-10-27 10:20:53
Formatstandard:function (date) {
var myyear = Date.getfullyear ();
var mymonth = Date.getmonth () +1;
var myweekday = Date.getdate ();
var myhour = date.gethours ();
var myminutes = Date.getminutes ();
var myseconds = Date.getseconds ();
if (Mymonth < 10) {
Mymonth = "0" + mymonth;
}
if (Myweekday < 10) {
Myweekday = "0" + myweekday;
}
if (Myhour <10) {
Myhour = "0" + myhour;
}
if (Myminutes <10) {
Myminutes = "0" + myminutes;
}
if (Myseconds <10) {
Myseconds = "0" + myseconds;
}
Return (myyear+ "-" +mymonth + "-" + Myweekday + "" +myhour+ ":" +myminutes+ ":" +myseconds ");
},
5 minutes before taking the time
var date = new Date ();
var date01 = date.setminutes (Date.getminutes ()-1);
var time01 = date.tolocaletimestring ();//Take time (12:12:12)-5 minutes before the time
JS get current time and take value operation