1.使用js时,如何获取系统当前时间并且得到格式为"yyyy年MM月"的日期;
1 var newdate = new Date();
2 var nowyear = newdate.getFullYear();
3 var nowmonth = newdate.getMonth()+1;
4 if (nowmonth >= 1 && nowmonth <= 9) {
5 nowmonth = "0" + nowmonth;
6 }
7 var sysTsuki = nowyear + "年" + nowmonth + "月";