The Date object has two methods of obtaining the Year:getFullYear () and getyear ()
Tested var dt = new Date ();
Alert (Dt.getyear ()): IE pop-up: Firefox browser popup: 117 (GetYear () returned in Firefox is the year from January 1, 1990, this is an outdated but not recommended method);
Alert (Dt.getfullyear ()): Two browser pop-ups are: 2017
Therefore, getFullYear () should be used instead of the getyear () method at any time;
Example:
For example the current is 2017
getFullYear () Returns the result: 2017
GetYear () The result returned is: 117 (2017-1990=117)
The following is the front end to get the current system time
varEndTime;
varBeginTime;
varDT =NewDate ();
varYear=dt.getfullyear ();
varMonth=dt.getmonth (+1);//The month obtained is from 0-11
var Day = Dt.getdate ();
if (month<10) {
endtime=year+"-"+"0"+month;
}else{
endtime=year+"-"+month;
}
if (day<10) {
EndTime + ="-"+"0"+day;
}else{
EndTime + ="-"+day;
}
begintime=year+"-"+" the"+"-"+" the";//Get the Year _ _ _ _-01-01
JS Get system Current Time getFullYear () and getyear ()